Author Topic: How to add a function to a pickup?  (Read 3403 times)

0 Members and 1 Guest are viewing this topic.

Offline javipg94

  • Street Thug
  • *
  • Posts: 13
    • View Profile
How to add a function to a pickup?
« on: February 10, 2008, 06:59:57 pm »
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

Offline mbalee

  • Street Thug
  • *
  • Posts: 32
    • View Profile
    • Hungarian GTA Site
Re: How to add a function to a pickup?
« Reply #1 on: February 10, 2008, 11:12:01 pm »
Hi! This is very easy! :P :D

Code: [Select]
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

Offline javipg94

  • Street Thug
  • *
  • Posts: 13
    • View Profile
Re: How to add a function to a pickup?
« Reply #2 on: February 10, 2008, 11:25:16 pm »
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..

Code: [Select]
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
« Last Edit: February 10, 2008, 11:40:47 pm by javipg94 »

szostol

  • Guest
Re: How to add a function to a pickup?
« Reply #3 on: February 12, 2008, 12:01:01 am »
Javi, I know how to do it.... and I do properties to my script so why you ask these questions?