Pickup doubt
#1

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?
Reply
#2

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 (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)