Pickup with arrays?
#2

You can either loop through the array checking each one
pawn Код:
for(new i = 0; i < sizeof(test);i++)\
{
     if(test[i] == pickupid)
     {
         ...
     }
}
or you can create an entry in an array positioned according to the pickupid, and simply check the pickupid's data that way
pawn Код:
#define MAX_ARRAY_PICK    600
...
new test[MAX_ARRAY_PICKUP];
...
//pickup creation script
test[CreatePickup(1232,23,123 /* whatever */ )] = 1;
...
public OnPlayerPickupPickup(playerid,pickupid)
{
     if(pickupid < MAX_ARRAY_PICKUP)
     {
         if(test[pickupid] == 1)
         {
            ...
         }
     }
     return 1;
}
Reply


Messages In This Thread
Pickup with arrays? - by almighty - 10.10.2010, 01:47
Re: Pickup with arrays? - by Rachael - 10.10.2010, 02:16
Respuesta: Pickup with arrays? - by almighty - 10.10.2010, 11:54
Re: Pickup with arrays? - by Rachael - 10.10.2010, 12:24

Forum Jump:


Users browsing this thread: 1 Guest(s)