06.09.2015, 19:20
Kick and ban command not working when i type server got crashed
Код:
CMD:kick(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 1) { new target,reason[64],str[128],logstring[200],month,day,year; new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Adminname, sizeof(Adminname)); GetPlayerName(target, Playername, sizeof(Playername)); getdate(year, month, day); if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, bojaz, "[INFO]: /kick [playerid] [reason]"); if(!IsPlayerConnected(target)) return SCM(playerid, bojaz, "Player is not connected!"); format(str, sizeof(str), "[Adm] %s has been kicked by '%s'. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day); printf(str); format(logstring, sizeof(logstring), "Info: %s was kicked by %s, reason: %s (%d-%d-%d).",sendername(target),sendername(playerid),reason,year,month,day); KickLog(logstring); SetTimerEx("kicktimer", 1000, false, "d", target); } else { SCM(playerid,bojaz,"You re not admin"); } return 1; }
Код:
CMD:ban(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 1) { new target; new reason[64]; new str[128]; new day,month,year; getdate(year, month, day); new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Adminname, sizeof(Adminname)); GetPlayerName(target, Playername, sizeof(Playername)); if(sscanf(params, "us[64]", target,reason)) return SCM(playerid, -1,"[INFO]: /ban [playerid] [reason]"); if(!IsPlayerConnected(target)) return SCM(playerid,bojaz, "** Player not found."); format(str, sizeof(str), "[Adm] %s has been banned by %s. Reason: %s (%d-%d-%d) ", Playername, Adminname, reason,year,month,day); SendClientMessageToAll(bojaz, str); printf(str); BanLog(str); PlayerInfo[target][pBanned] = 1; SetTimerEx("bantimer", 1000, false, "d", target); } else { SCM(playerid,bojaz,"Your not admin"); } return 1; }