06.12.2014, 17:04
If i mute player for 5 min, when he left the server and come back again after theese 5 minutes it's bugged. He is still muted. How to fix it?
Код:
CMD:mute(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id, time, reason[128]; if(sscanf(params, "dds[128]", id, time, reason)) return SendClientMessage(playerid, WHITE, "USAGE:/mute (ID) (minutes) (reason)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, RED, "Player not found!"); if(PlayerInfo[id][pMuted] == 1) return 1; if(PlayerInfo[id][pAdmin] >= 5) { SendClientMessage(playerid, RED, "You cannot mute 5 level admin!"); } else { new adname[MAX_PLAYER_NAME], tt[MAX_PLAYER_NAME], str[250]; GetPlayerName(playerid, adname, sizeof(adname)); GetPlayerName(id, tt, sizeof(tt)); mtimer = SetTimerEx("UnMute",time*1000*60,0,"i",id); PlayerInfo[id][pMuted] = 1; format(str, sizeof(str), "ADMIN: %s is muted by admin %s за %d minutes. Reason: %s", tt, adname, time, reason); SendClientMessageToAll(RED, str); return 1; } } else return SendClientMessage(playerid, RED, "You are not an admin!"); return 1; }