i don't understand settimer
#2

Okay,

Put this ON TOP of your script:
pawn Код:
new given[MAX_PLAYERS];
Put this under: OnGameModeInt
pawn Код:
moneys=CreatePickup(1274,1,2057.29, 1531.57, 10.67);
//The pickup (change the coords if you want) Its infront of ship (LV)
This under OnPlayerPickupPickup
pawn Код:
{
    if(pickupid == import)
        {
if(given[playerid]==1) return SendClientMessage(playerid, 0xFF0000AA, "Come back in 30 seconds!"); // if he got it already it returns

        SendClientMessage(playerid, 0x0A8F00FF, "You became 5000$! Come back in 30 seconds to get another 5000$.");
        GivePlayerMoney(playerid, 5000); // Gives him 5000
        given[playerid]=1;  // let the system know that he got it
        SetTimerEx("MGiver",30000,0,"d",playerid); // starts the 30 sec timer
}
In the end of your script:

pawn Код:
forward MGiver(playerid);
public MGiver(playerid)
{
    given[playerid]=0; // now he can enter again
}
This is untested, but it should work.
Would be nice if you say me if this was good.

Jeffry
Reply


Messages In This Thread
i don't understand settimer - by RobShakur - 24.01.2010, 14:59
Re: i don't understand settimer - by Jeffry - 24.01.2010, 15:23
Re: i don't understand settimer - by RobShakur - 24.01.2010, 16:42
Re: i don't understand settimer - by [dN]Eagle - 24.01.2010, 16:45
Re: i don't understand settimer - by RobShakur - 24.01.2010, 17:05
Re: i don't understand settimer - by RobShakur - 24.01.2010, 17:58

Forum Jump:


Users browsing this thread: 2 Guest(s)