23.09.2013, 17:44
pawn Код:
if(PickedUpPickup[playerid] != 0)//If they have picked up a pickup...
{
SendClientMessage(playerid, COLOR_ORANGE, "**[SERVER]** {FFFFFF}- You need to wait at least {FF0000}5 seconds{FFFFFF} before picking up another pickup!");
return 1;//Ends the code, not allowing the pickup.
}
PickedUpPickup[playerid] = 1;//Sets the 'PickedUpPickup' variable to has picked somthing up.
SetTimerEx("PickedUpPickupReset", 4500, false, "i", playerid);
pawn Код:
public PickedUpPickupReset (playerid)//The timer that resets the variable 'PickedUpPickup' to 0 (Nothing picked up within 4.5 seconds).
{
PickedUpPickup[playerid] = 0;
return 1;
}
P.S. - Credit for that goes to: jakejohnsonusa.