14.02.2016, 15:01
Server crashes or restarts when someone uses this command:
Код:
CMD:ban(playerid, params[]) { new string[128], str[356], id, reason[1024], ip[50]; if(PlayerInfo[playerid][pAdmin] >= 4) { if(sscanf(params, "us[1024]", id, reason)) return GameTextForPlayer(playerid, "~g~/ban~w~~n~(id)~w~~n~(reason)",4500,3); if(PlayerInfo[playerid][pAdmin] < PlayerInfo[id][pAdmin]) return ErrorMessages(playerid, 3); if(id == INVALID_PLAYER_ID) return GameTextForPlayer(playerid, "~g~Player is not connected",4500,3); PlayerInfo[id][BanC]++; GetPlayerIp(id, ip, sizeof(ip)); format(str, sizeof(str), "%s(%d) has been banned by Administrator %s(%d) (Reason: %s) (Ip of Player: %s)", GetName(id), id, GetName(playerid), playerid, reason, ip); SaveIn("banlog", str); format(str, sizeof(str), ""COL_GREEN"Banned Player %s(%d)\n\n- Name: %s\n- Account ID: %d\n- Reason: %s\r\n\n", GetName(id),id,GetName(id),PlayerInfo[id][Accountid],reason); ShowPlayerDialog(playerid, 900, DIALOG_STYLE_MSGBOX, ""COL_GREEN"UGF - Banned",str,"OK",""); format(string, sizeof(string), "%s(%d) has been banned by Administrator %s(%d) (Reason: %s)", GetName(id), id, GetName(playerid), playerid, reason); SendClientMessageToAll(BAN, string); format(string, sizeof(string), "You have been banned by Administrator %s(%d) (Reason: %s)", GetName(playerid), playerid, reason); SendClientMessage(id, BAN, string); PlayerInfo[id][Banned] = 1; SetTimerEx("Kick", 1000, false, "i", playerid); } else return 0; return 1; }