20.04.2012, 14:37
Ok thanks but now I have to do so the command only works like this:
/RemWarn [PlayerID]
(Without having to type a reason).
This is how the command looks like now:
/RemWarn [PlayerID]
(Without having to type a reason).
This is how the command looks like now:
pawn Код:
CMD:remwarn(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 2) {
new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid,LIGHTBLUE2, "Usage: /RemWarn [PlayerID]") && SendClientMessage(playerid,orange, "Function: Will remove a warning from a specified player");
new warned = strval(tmp), str[128];
if(PlayerInfo[warned][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(warned) && warned != INVALID_PLAYER_ID) {
if(warned != playerid) {
CMDMessageToAdmins(playerid,"Warn");
PlayerInfo[warned][Warnings]--;
if( PlayerInfo[warned][Warnings] == MAX_WARNINGS) {
format(str, sizeof (str), "4|- Administrator \"%s\" has kicked \"%s\". | Reason: %s (Warnings: %d/%d) -|", pName(playerid), pName(warned), params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, str);
format(str, sizeof (str), "|- Administrator \"%s\" has kicked \"%s\". | Reason: %s (Warnings: %d/%d) -|", pName(playerid), pName(warned), params[1+strlen(tmp)], PlayerInfo[warned][Warnings], MAX_WARNINGS);
SendClientMessageToAll(red, str);
SaveToFile("KickLog",str); Kick(warned);
return PlayerInfo[warned][Warnings] = 0;
} else {
format(str, sizeof (str), "8|- Administrator \"%s\" has removed a warning from \"%s\" | (Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);
IRC_GroupSay(gGroupID, IRC_CHANNEL, str);
IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, str);
format(str, sizeof (str), "|- Administrator \"%s\" has removed a warning from \"%s\" | (Warnings: %d/%d) -|", pName(playerid), pName(warned), PlayerInfo[warned][Warnings], MAX_WARNINGS);
return SendClientMessageToAll(yellow, str) && SaveToFile("WarnLog",str);
}
} else return SendClientMessage(playerid, red, "ERROR: You cannot remove your own warnings");
} else return SendClientMessage(playerid, red, "ERROR: Player is not connected");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}