24.03.2015, 06:16
Okay so.. I have this command. In game, when I do /ban itself, it shows me the usage. but then when I do /ban with the player Id and reason EX: /ban 1 faggot, it says Unknown Command. So can someone please help me because I don't' know what else to do really. Here's the code for my /ban and /systemban, because I tried both and they both do the same thing.
Код:
CMD:ban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason, log[250]; if(!sscanf(params, "us[250]", giveplayerid, reason)) { if(PlayerInfo[playerid][pAdmin] < PlayerInfo[giveplayerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "Player has a higher admin level than you."); if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { new string[256]; format(string, sizeof(string), "System: %s has been banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); SendClientMessageToAll(COLOR_ORANGE, string); format(log, sizeof(log), "BAN: %s was banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Ban [Player ID] [Reason]"); } } return 1; } CMD:systemban(playerid, params[]) { if(!IsLoggedEx(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must login before using any commands."); if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid)) { new giveplayerid, reason, log[128]; if(!sscanf(params, "us[128]", giveplayerid, reason)) { if(!IsPlayerConnected(giveplayerid)) { SendClientMessage(playerid, COLOR_WHITE, "That player is not connected."); } else { new string[256]; format(string, sizeof(string), "System: %s has been Auto-Banned by the System. Reason: %s.", PlayerName(giveplayerid), reason); SendClientMessageToAll(COLOR_BRIGHTRED, string); format(log, sizeof(log), "SYSTEM-BAN: %s was System-Banned by %s. Reason: %s.", PlayerName(giveplayerid),PlayerName(playerid), reason); Log("Logs/Ban.log", log); PlayerInfo[giveplayerid][pBanned] = 1; AddBan(GetPlayerIpEx(giveplayerid)); } } else { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /SystemBan [Player ID] [Reason]"); } } return 1; }