onPickupPickedUp doesnt work

Started by Kewun, Aug 07, 2016, 09:56 AM

Previous topic - Next topic

Kewun

Quote from: KAKAN on Aug 08, 2016, 01:14 PM@Kewun, check your onPickupClaimPicked function.
Check whether it returns true or false. And too, if it has nothing it, just add a return 1; to it or simply add your code to that function.

added return 1; still not effecs


Mötley

I'm going to guess that the weapon is not being set?

If so try to replace with player.GiveWeapon(4);As well player.SetWeapon(4);This typically generates a random number if anything, If I recall correctly...



Did you add a cash function to that weapon case? if so remove it as a second test      /*if (cash < 250) {
         MessagePlayer("[#ffffff]You dont have enough cash to buy colt45, need $250",player);
         return false;
      }*/


Other than that no clue as of why it would not work. I have not tested anything..

Kewun


Kewun


Kewun

and my pickups are created with following format:
function onScriptLoad()
{
   CreatePickup( 274, Vector(368.053, 1050.34, 19.213)) // PISTOL
   CreatePickup( 283, Vector(365.96, 1050.13, 19.213)) // UZI
   CreatePickup( 277, Vector(363.171, 1050.22, 19.213)) // SHOTGUN
   CreatePickup( 366, Vector(385.615, 1210.76, 19.4767)) // HEALTH
   CreatePickup( 366, Vector(468.686, 695.558, 12.1433)) // HEALTH
   CreatePickup( 262, Vector(407.347, -487.586, 12.3432)) // BASEBALL BAT
   CreatePickup( 368, Vector(385.499, -469.809, 12.3432)) // ARMOUR
}

Mötley

#21
You should be using the create weapon function I uploaded as its fully modifiable. As I plan to create a way to do something like   

GetMaxPickupsGetMaxPickups <- 20;I just need to actually get a blank server copy and do it.
to use in the method of
for ( local i = 0; i < GetMaxPickups; i++ ) to be able to spawn pickups better if needed.

I will get a blank server copy and run some test ;)

Just realized after moving I can not find my Vice city disc so I can not help you at all or script this sorry.

Kewun

im so stupid.

i had 2x times function onpickup piked up

i fixed my self.. thx to all lol

KAKAN

Quote from: Kewun on Aug 10, 2016, 06:17 PMim so stupid.

i had 2x times function onpickup piked up

i fixed my self.. thx to all lol
Use classes as event handlers( hope you know what I mean )
A clever trick will do your work, also, it's much more reliable since you don't have to worry about the same function being repeated 2 times.
oh no