SA-MP Forums Archive
Lil thing - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Lil thing (/showthread.php?tid=84231)



Lil thing - FrazZ - 29.06.2009

How could i make this:

If your inside the pickup, you get 5000$. But when you get the 5000 dollars, you must wait 1 hour to get more money.

Anyone know? Im just stumped on this one.


Re: Lil thing - AiVAMAN - 29.06.2009

Top of your script:
pawn Код:
forward MoneyTimer(playerid); //Forward for a timer
new Money; //Pickup
new MoneyEntered[MAX_PLAYERS]; //Checks if player has entered pickup
OnGameModeInit:
pawn Код:
Money = CreatePickup(blah blah blah); //Creating pickup
above of your script:
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;
}
Hope this solved your problem. :P


Re: Lil thing - FrazZ - 29.06.2009

I cannot thank you enough. THANKS A BUNCH!


Re: Lil thing - AiVAMAN - 30.06.2009