Pickup doubt - 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 doubt (
/showthread.php?tid=424771)
Pickup doubt -
P3DRO - 23.03.2013
I understand the basics of the pickup system, BUT i have a doubt.
If i have 5 health pickups do i have to create 5 different vars or just 1 since they are all the "same" pickup?
Re: Pickup doubt -
[..MonTaNa..] - 23.03.2013
You have to create 5 different vars,
Example:
public OnGameModeInit()
{
pawn Код:
pickup_armour = CreatePickup(1242, 2, 16.6172,1409.7006,10.8849, 0); //DryLake ArmourPickup
pickup_health = CreatePickup(1240, 2, 29.7902,1410.7526,11.1964, 0); //DryLake HealthPickup
pickup_armour = CreatePickup(1242, 2, 1766.6212,-2266.5012,31.0900, 0); //Lsi ArmourPickup
pickup_health = CreatePickup(1240, 2, 1763.9866,-2266.1663,31.0900, 0); // Lsi HealthPickup
return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickup_armour)
{
SetPlayerArmour(playerid, 100);
}
if(pickupid == pickup_health)
{
SetPlayerHealth(playerid, 100);
}
if(pickupid == pickup_armour)
{
SetPlayerArmour(playerid, 100);
}
if(pickupid == pickup_health)
{
SetPlayerHealth(playerid, 100);
}
return 1;
}
+ REP if it helped you please (: