Pickup Help - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pickup Help (
/showthread.php?tid=182571)
Pickup Help -
Steven82 - 11.10.2010
Alright so i was wondering, when using
Does it have to be assigned as a Variable to make it work or can i just use it as pickup id 1 EX
pawn Код:
new ex1;
new ex2;
ex1 = CreatePickup(blah,blah)
ex2 = CreatePickup(blah,blah)
Or can i just do this
pawn Код:
CreatePickup(blah,blah)// Id=1
CreatePickup(blah,blah)// Id=2
And so it would look like this for OnPlayerPickupPickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == 1)
{
// Code here
}
if(pickupid == 2)
{
// Code here
}
return 1;
}
I am just wondering, because i am making a lot of pickups in my script and i don't want to use a shitload of variables.
Re: Pickup Help -
Rndom - 11.10.2010
1st - Pickup IDs start from 0 NOT 1, this may cause a problem if you DON'T use variables
2nd - Usage of variables are not needed but if you forget the ID of a pickup or what it does, you are fucked
Soo... To the point variables are good even you got shitloads of those, use them or not - it, is, your, choice...
I personally use variables as they are for easier access,
Thanks.
Re: Pickup Help -
Steven82 - 11.10.2010
Oh ok thanks man i was going to answer this myself, but had to go to school and thanks
Re: Pickup Help -
Simon - 11.10.2010
Go into
this topic and read the "
Assumptions" section.
The problem is not about simply forgetting the ID of the pickup. You're setting yourself up for a world of hurt if you ever decide to start deleting pickups or you have other scripts which create pickups.