SA-MP Forums Archive
Pickup problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pickup problem (/showthread.php?tid=347446)



Pickup problem - Jimbo01 - 01.06.2012

I have 1 static pickup at my gm

It's under OnGameModeInIt
Код:
AddStaticPickup(1239, 2, 2176.3914,-2258.8840,14.7734, 0);
And i have 1 createpickup (its mini-mission it appears with a timer)

It's under OnPlayerPickUpPickup

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == MINIMISSIONPICKUP)
The Problem is i enter the normal pickup "addstaticpickup" it gives me minimissinpickup...


Re: Pickup problem - Sandiel - 01.06.2012

Are you sure you defined the two pickups above OnGameModeInit
then under GameModeInit have you put
Код:
 CreatePickup(......);
Try that, then it should work.
Also, are you getting any error lines when you compile?


Re: Pickup problem - Jonny5 - 01.06.2012

make sure you have

pawn Код:
MINIMISSIONPICKUP = CreatePickup(...);
this is the only way MINIMISSIONPICKUP will know the pickup id.


Re: Pickup problem - Jimbo01 - 01.06.2012

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
make sure you have

pawn Код:
MINIMISSIONPICKUP = CreatePickup(...);
this is the only way MINIMISSIONPICKUP will know the pickup id.
yea i did that...


Re: Pickup problem - Sandiel - 01.06.2012

It's CreatePickup, not AddStaticPickup....


Re: Pickup problem - FalconX - 01.06.2012

Quote:
Originally Posted by Jimbo01
Посмотреть сообщение
yea i did that...
pawn Код:
AddStaticPickup(1239, 2, 2176.3914,-2258.8840,14.7734, 0);
This doesn't really return any kind of pickupid so you must use CreatePickup like the following:-

pawn Код:
new YOUR_VAR; // on top

YOUR_VAR = CreatePickup( 1239, 2, 2176.3914,-2258.8840,14.7734, 0 ); // on gamemode init

public OnPlayerPickUpPickup( playerid, pickupid )
{
    if( pickupid == YOUR_VAR )
    {
        // your function
    }
    return 1;
}
CreatePickup works same as AddStaticPickup but it does return a pickup id.

Hope this helps
-FalconX