22.10.2012, 19:55
Here you go, I also cleaned your code up since it was a mess
pawn Код:
IRCCMD:warn(botid, channel[], user[], host[], params[]) {
if(IRC_IsOp(botid, channel, user)) {
new ID, reason[64], string[128], pname[24], string2[128];
if(isnull(params))
return IRC_GroupSay(gGroupID, channel,"3Usage: !warn [playerid] [reason]");
if(!IsPlayerConnected(ID))
return IRC_GroupSay(gGroupID, channel,"4*** Error: Invalid player ID.");
GetPlayerName(ID, pname, 24);
format(string, sizeof(string), "Admin %s (IRC) has warned %s (%d) for: %s", user, pname, ID, reason);
SendClientMessageToAll(COLOR_GREEN, string);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
IRC_GroupSay(gGroupID,IRC_ACHANNEL, string);
SendClientMessage(ID, red, "You have been warned by an IRC admin (IRC) to follow the rules.");
SendClientMessage(ID, red, "Please follow the rules with /rules");
PlayerInfo[ID][pWarn] ++;
SetPVarInt(ID, "Warnings", GetPVarInt(ID, "Warnings") +1);
if(GetPVarInt(ID, "Warnings") == 3) {
format(string2, sizeof(string2), "[AUTO KICK] %s (%d) Too many admin warnings.", pname, ID);
SendClientMessageToAll(COLOR_RED, string2);
IRC_GroupSay(gGroupID,IRC_CHANNEL, string2);
IRC_GroupSay(gGroupID,IRC_ACHANNEL, string2);
Kick(ID)
}
}
return 1;
}