Command timer
#1

how to make, that player can use command every 1 minute

command:
Код:
CMD:report(playerid, params[])
{
	new rp[128], string[128];
	if(sscanf(params, "s[128]", rp))return Koristi(playerid, "/report [Tekst]");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(PlayerInfo[i][pAdmin] >= 1)
		{
			format(string, sizeof(string), "|R| %s (%d): %s",PlayerName(playerid), playerid, rp);
			SendClientMessage(i, COLOR_ORANGE, string);
		}
	}
	format(string, sizeof(string), "Vas report je poslan: %s", rp);
	SendClientMessage(playerid, COLOR_YELLOW, string);
	return 1;
}
i want that player can send report to administrators every 1 minute
Reply
#2

pawn Код:
CMD:report(playerid, params[])
{
    if(GetPVarInt(playerid,"ABUSE")>GetTickCount())return SendMessageToPlayer(playerid,0xFF0000FF,"You must wait 1 minute before reporting to the admins.");
    SetPVarInt(playerid,"ABUSE",GetTickCount()+60000);
    new rp[128], string[128];
    if(sscanf(params, "s[128]", rp))return Koristi(playerid, "/report [Tekst]");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][pAdmin] >= 1)
        {
            format(string, sizeof(string), "|R| %s (%d): %s",PlayerName(playerid), playerid, rp);
            SendClientMessage(i, COLOR_ORANGE, string);
        }
    }
    format(string, sizeof(string), "Vas report je poslan: %s", rp);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
}
Reply
#3

EDIT: Ninja'd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)