06.12.2012, 19:33
Hey, I need to add so I can set a timer to my mute command. Could I have some help please?
Code:
if(strcmp("/mute", cmd, true) == 0) { new tmp[256], tmp2[256], cmdid; tmp = strtok(cmdtext, idx); tmp2 = strtok(cmdtext, idx); if(PlayerInfo[playerid][AdminLevel] < 1) return 0; if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "/mute [id] [reason]"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_RED, "That player is not connected"); if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "/mute [id] [reason]"); cmdid = strval(tmp); if(PlayerInfo[cmdid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid,COLOR_ORED,"You cant use this command against a higher level admin!"); new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); new oname[MAX_PLAYER_NAME]; GetPlayerName(cmdid, oname, sizeof(oname)); new string[256]; if(cmdid >= 0 && cmdid <= 9) { format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[7]); } else if(cmdid >= 10 && cmdid <= 99) { format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[8]); } else if(cmdid >= 100 && cmdid <= 150) { format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[9]); } SendClientMessageToAll(COLOR_YELLOW, string); muted[cmdid] = 1; printf(string); return 1; }