Need help with Setting a Timer.
#4

Quote:
Originally Posted by lulo356
Посмотреть сообщение
pawn Код:
//on the top of your script
new GiftTimer[MAX_PLAYERS];
new GiftgTimer[MAX_PLAYERS];
pawn Код:
CMD:getgift(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1128.26636, -1450.60254, 14.66266))
    {
        Random = random(3);
        switch(Random)
        {
            case 0:
            {
                GivePlayerMoney(playerid, 250000);
                SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 250,000$! Merry christmas!");
            }
            case 1:
            {
                SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
                SendClientMessage(playerid, 0xFF0000FF ,"[GiftBox:] {FFFFFF}You have received 1 levelup! Merry christmas!");
            }
        }
    }
    else
    {
        SendClientMessage(playerid, -1, "You are not at the christmas tree!");
    }
    GiftTimer[playerid] = 1;
    GiftgTimer[playerid]= SetTimerEx("Giftg", 1000, false, "d", playerid);
    return 1;
}
pawn Код:
//place it on the buttom of your script
forward Giftg(playerid);
public Giftg(playerid)
{
    GiftTimer[playerid] = 0;
    SendClientMessage(playerid,0x42CC33C8, "You have to wait 1 minute to use /getgift again.");
    return 1;
}
I have done everything you said. But it won't work :/
I can still use that command whenever i want.
Reply


Messages In This Thread
Need help with Setting a Timer. - by danielpalade - 06.12.2014, 01:26
Re: Need help with Setting a Timer. - by MohanedZzZ - 06.12.2014, 01:43
Re: Need help with Setting a Timer. - by lulo356 - 06.12.2014, 01:57
Re: Need help with Setting a Timer. - by danielpalade - 06.12.2014, 13:13
Re: Need help with Setting a Timer. - by lulo356 - 06.12.2014, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)