SA-MP Forums Archive
timer - 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)
+--- Thread: timer (/showthread.php?tid=549720)



timer - StR_MaRy - 08.12.2014

hi, how can i make a timer for a cmd ?
INI script pls not mysql this is the cmd

if (strcmp(cmdtext, "/armura", true)==0)
{
if(PlayerInfo[playerid][pDonateRank] >= 4)
{
SetPlayerArmour(playerid, 100.0);
if(armuratime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "Doar o data pe Cont.");
SendClientMessage(playerid, COLOR_GREY,"[PREMIUM]: Ai primit Armura mai poti folosi dupa 10 minute.");
SetTimerEx("armurat", 600000, 0, "%d", playerid);
return 1;
}
}
i have a timer but is not working


Re: timer - HY - 08.12.2014

pawn Код:
if (strcmp(cmdtext, "/armura", true)==0)
{
    if(PlayerInfo[playerid][pDonateRank] >= 4)
    {
        SetPlayerArmour(playerid, 100);
        if(armuratime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "Doar o data pe Cont.");
        SendClientMessage(playerid, COLOR_GREY,"[PREMIUM]: Ai primit Armura mai poti folosi dupa 10 minute.");
        SetTimerEx("armurat", 600000, 0, "i", playerid);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Nu esti Donator");
    }
    return 1;
}



Re: timer - Clad - 08.12.2014

pawn Код:
if (strcmp(cmdtext, "/armura", true)==0)
{    
if(PlayerInfo[playerid][pDonateRank] >= 4)
{        
SetPlayerArmour(playerid, 100);
if(armuratime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "Doar o data pe Cont.");        SendClientMessage(playerid, COLOR_GREY,"[PREMIUM]: Ai primit Armura mai poti folosi dupa 10 minute.");        SetTimerEx("armurat", 600000, 0, "i", playerid);
}    
else
{
SendClientMessage(playerid, COLOR_GREY, "Nu esti Donator");
    }    
return 1;
}



Re: timer - StR_MaRy - 08.12.2014

no cmd is working i have this

forward armurat(playerid);
new armuratime[MAX_PLAYERS];

end of gm:
public armurat(playerid)
{
armuratime[playerid] = 0;
}

under cmd:
if(bantime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "** Are you trying to ban this server?");
armuratime[playerid] = 1;
SetTimerEx("armurat", 600000, 0, "%d", playerid);

this is my time system


Re: timer - StR_MaRy - 08.12.2014

np i found something armuratime[playerid] = 1;