10.06.2014, 12:50
Hello guys so basicly i've got a command like this.
How can i make a timmer so a play can only type that once every 1 minute?
Код:
CMD:am(playerid, params[]) { if(IsAdmin(playerid)) { new toid, message[65]; if(sscanf(params, "us[65]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]"); if(strlen(message) > 65) return Error(playerid, "Your message cannot be longer than 65 characters."); if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!"); new string[128]; format(STRING, "Admin message from %s: %s", GetPlayerNameEx(playerid), message); SendClientMessageEx(toid, COLOR_GREEN, string); format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message); SendAdminMessage(COLOR_GREEN,string); Log("logs/adminmessage.log", string); } else { new message[80]; if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]"); if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters."); new string[128]; format(STRING, "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message); SendAdminMessage(COLOR_GREEN,string); format(STRING, "Your message, %s, has been sent.", message); SendClientMessageEx(playerid, COLOR_GREEN, string); format(STRING, "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message); Log("logs/adminmessage.log", string); } return 1; }