Posts: 265
Threads: 59
Joined: Sep 2013
Quote:
Originally Posted by jakejohnsonusa
Add this to the top of your script:
pawn Код:
forward PickedUpPickupReset(playerid);//Timer prepertaion or the "forward" PickedUpPickup[MAX_PLAYERS] = 0;//Variable to hold if the player has picked somthing up. 0 = No, 1 = Yes
Add this to the OnPlayerPickUpPickupin your script (Obviously don't copy the public OnPlayerPickUpPickup part if you already have it):
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid) { if(PickedUpPickup[playerid] != 0)//If they have picked up a pickup... { SendClientMessage(playerid, -1, "* You need to wait at least 5 seconds 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);//Sets a timer to reset the 'PickedUpPickup' variable to 0... 4.5 seconds. }
Then add this to the end 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; }
Hope that helps!
|
This is what I am getting :/
pawn Код:
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(24) : error 010: invalid function or declaration
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(925) : error 017: undefined symbol "PickedUpPickup"
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(925) : warning 215: expression has no effect
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(925) : error 001: expected token: ";", but found "]"
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(925) : error 029: invalid expression, assumed zero
C:\Users\xxx\Desktop\xxx\gamemodes\xxx.pwn(925) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.