Lil thing
#1

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.
Reply
#2

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
Reply
#3

I cannot thank you enough. THANKS A BUNCH!
Reply
#4

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)