Little question about yTimers.
#9

I've just noticed a flaw in my code, wasn't thinking when I coded it:

pawn Код:
new rcd[MAX_PLAYERS];
CMD:report(playerid,o[])
{
    new msg[80],str[128],pname[MAX_PLAYER_NAME];

    if(sscanf(o,"s[80]",msg)) return SCM(playerid,COLOR_LIGHTBLUE,"USAGE:/report [text]");
    if(!rcd[playerid] || gettime() >= rcd[playerid] + 15)
    {
        rcd[playerid] = gettime();
        GetPlayerName(playerid,pname,sizeof(pname));
        format(str,sizeof(str),"Report from %s(%i): %s",pname,playerid,msg);
        SAM(COLOR_AQUA,str);
        SCM(playerid,COLOR_YELLOW,"Your report has been sent to the online administrators.");
    }
    else
    {
        SCM(playerid,COLOR_LIGHTBLUE,"You must wait 15 seconds in order to send another report!");
    }
    return true;
}
Reply


Messages In This Thread
Little question about yTimers. - by moadi - 10.11.2011, 22:37
Re: Little question about yTimers. - by Norn - 10.11.2011, 22:39
Re: Little question about yTimers. - by moadi - 10.11.2011, 22:45
Re: Little question about yTimers. - by Norn - 10.11.2011, 22:50
Re: Little question about yTimers. - by moadi - 10.11.2011, 23:01
Re: Little question about yTimers. - by moadi - 10.11.2011, 23:12
Re: Little question about yTimers. - by Norn - 10.11.2011, 23:13
Re: Little question about yTimers. - by moadi - 10.11.2011, 23:15
Re: Little question about yTimers. - by Norn - 10.11.2011, 23:18
Re: Little question about yTimers. - by moadi - 10.11.2011, 23:20

Forum Jump:


Users browsing this thread: 2 Guest(s)