29.06.2009, 18:51
Top of your script:
OnGameModeInit:
above of your script:
Hope this solved your problem. :P
pawn Код:
forward MoneyTimer(playerid); //Forward for a timer
new Money; //Pickup
new MoneyEntered[MAX_PLAYERS]; //Checks if player has entered pickup
pawn Код:
Money = CreatePickup(blah blah blah); //Creating pickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Money) //When player enters pickup
{
if(MoneyEntered[playerid] == 1) return SendClientMessage(playerid, 0xFF0000AA, "You have to wait an hour to pick up this pickup again!"); //If the player has entered the pickup when the 1 hour hasn't ran out.
GivePlayerMoney(playerid, 5000); //Player gets money
MoneyEntered[playerid] = 1; //Sets him, that he has get the money
SetTimer("MoneyTimer", 3600000, 0); //Setting timer (1 hour)
SendClientMessage(playerid, 0x33FF33AA, "You have picked up $5000!"); //Sending him a message
}
return 1;
}
public MoneyTimer(playerid) //When 1 hour rans out
{
MoneyEntered[playerid] = 0; //Sets, that player hasn't picked up the pickup
SendClientMessage(playerid, 0xFF0000AA, "You can now pickup your $5000!"); //Sending him a message
return 1;
}