25.11.2011, 12:44
Here are my commands, can anyone tell me why I am getting these warnings which stop the commands from working?
In advanced, thanks
Код:
CMD:ban(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 2) { new string[128], giveplayerid, reason[64]; if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COL_GREY, "Use, /ban [playerid] [reason]"); if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) { format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", GetPlayerName(playerid)); ABroadCast(COL_YELLOW,string,2); PlayerInfo[playerid][pBanned] = 1; new ip[32]; GetPlayerIp(playerid,ip,sizeof(ip)); AddBan(ip); Kick(playerid); return 1; } else { new year, month,day; getdate(year, month, day); new playerip[32]; GetPlayerIp(giveplayerid, playerip, sizeof(playerip)); format(string, sizeof(string), "AdmCmd: %s(IP:%s) was banned by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year); Log("logs/ban.log", string); format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason); SendClientMessageToAll(COL_RED, string); PlayerInfo[giveplayerid][pBanned] = 1; format(PlayerInfo[giveplayerid][pFlag], 128, ""); new ip[32]; GetPlayerIp(giveplayerid,ip,sizeof(ip)); AddBan(ip); Kick(giveplayerid); return 1; } } } else SendClientMessage(playerid, COL_GREY, "Invalid player specified."); return 1; } CMD:kick(playerid, params[]) { if (PlayerInfo[playerid][pAdmin] >= 2) { new string[128], giveplayerid, reason[64]; if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessage(playerid, COL_GREY, "Use, /kick [playerid] [reason]"); if(IsPlayerConnected(giveplayerid)) { if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin]) { format(string, sizeof(string), "AdmCmd: %s has been auto-kicked, reason: Trying to /kick a higher admin.", GetPlayerName(playerid)); ABroadCast(COL_YELLOW,string,2); Kick(playerid); return 1;