15.06.2014, 00:17
pawn Код:
#define PICKUP_DELAY 5
//This means you want 5 second delays between pickups. You can change this to whatever you want.
new LastPickup[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
LastPickup[playerid] = 0; //Reset the LastPickup for the player.
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if((gettime() - LastPickup[playerid]) < PICKUP_DELAY) return 1;
if(pickupid == 1) //Example
{
//Your code
}
LastPickup[playerid] = gettime();
return 1;
}
pawn Код:
if((gettime() - LastPickup[playerid]) < PICKUP_DELAY) return 1;
Sources:
https://sampwiki.blast.hk/wiki/Gettime
https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup