OnPlayerPickupPickup
#3

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);
Bottom of your script:

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;
}
Enjoy!

P.S. - Credit for that goes to: jakejohnsonusa.
Reply


Messages In This Thread
OnPlayerPickupPickup - by Blackazur - 21.09.2013, 10:28
Re: OnPlayerPickupPickup - by hossa - 23.09.2013, 17:40
Re: OnPlayerPickupPickup - by CesarLT - 23.09.2013, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)