15.02.2011, 22:14
Checking for each item would be slightly faster but you would need lot more text which would make your file unused big
A switch wont work, switch only work with constant values
Just use a loop like you already did and add a return 1 in it because an item can only be found once
Or add a break (which stops the loop) if some other code should be executed in the callback
A switch wont work, switch only work with constant values
Just use a loop like you already did and add a return 1 in it because an item can only be found once
Or add a break (which stops the loop) if some other code should be executed in the callback
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
Loop(i, sizeof Pickup)
{
if(pickupid == Pickup[i])
{
//code
return 1;
}
}
Loop(i, sizeof EntrancePickup)
{
if(pickupid == EntrancePickup[i])
{
//code
return 1;
}
}
return 1;
}