31.07.2014, 21:29
I made a simple newbie chat command which works fine, but I was wondering how I would make a delay so players could only use it every 30 seconds? Here is my command:
Код:
CMD:n(playerid,params[]) { if(PlayerInfo[playerid][pToggleNewbie] == 1) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} You currently have newbie chat toggled off."); if(PlayerInfo[playerid][pNewbieMuted] == 1) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} You are currently muted from using the newbie chat."); if(ToggleNewbie == 1) return SendClientMessage(playerid,-1,"{AA3333}ERROR:{FFFFFF} The newbie chat is currently disabled by an administrator."); { new question[128]; if(sscanf(params,"s[128]",question)) return SendClientMessage(playerid,-1,"{AA3333}USAGE:{FFFFFF} /n(ewbie) (question)"); { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pToggleNewbie] == 0) { new newbie[128]; format(newbie,128,"[NewbieChat] Player %s [%i]: %s",RemoveUnderScore(playerid),playerid,question); SendClientMessage(i,COLOR_NEWBIE,newbie); } } } } } return 1; }