• Welcome to Vice City Multiplayer.
 

How to add a function to a pickup?

Started by javipg94, February 10, 2008, 03:59:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

javipg94

Hai, :)

I know how to add the pickup but not how to add a function on it.
Like.. if you get the flower , it will teletransport you.. Need help :x


Thanks :D

mbalee

Hi! This is very easy! :P :D

on *:SIGNAL:vcmp.pickup:{
  var %name = $vcmp.name($1)
  var %name2 = $replace($replace($vcmp.name($1),[,~),],~)
  var %id = $1



  if ($3 == PICKUPID) {
    set %a $rand(100,200)
    vcmp.cash+ %id %a
    vcmp.msg %id ;example CASH PICKUP: Picked Up Cash - Amount: $ $+ %a $+ , Location: $vcmp.area(%id)
  }
  elseif ($3 == PICKUPID) {
    %a = $rand(10,20)
    vcmp.msg %id ;example DEATH PICKUP - HP Lost: %a $+ , Location: $vcmp.area(%id)
    vcmp.sethp %id $calc($vcmp.hp(%id) - %a)
  }
}


I hope for it I helped, if do not write then though in msn. :) :P

javipg94

#2
Hai :)
-  Last question
I want to create 2 pickups with the ID = 107.
1pickupId 107 = DOCKS and when you pickup it ups you to the roof
2pickupId 107 = Downtown if you pickup you get armour..

if ($3 == 107) {
    set %a $rand(100,200)
    vcmp.cash+ %id %a
    vcmp.msg %id ;example CASH PICKUP: Picked Up Cash - Amount: $ $+ %a $+ , Location: $vcmp.area(%id)
  }

  if ($3 == 107) {
    set %a $rand(100,200)
    vcmp.cash+ %id %a
    vcmp.msg %id ;example CASH PICKUP: Picked Up Cash - Amount: $ $+ %a $+ , Location: $vcmp.area(%id)
  }


Where to add there 1 function to the docks pickup and another function to downtown pickup?


Thanks Regards. :D

szostol

Javi, I know how to do it.... and I do properties to my script so why you ask these questions?