22.10.2012, 18:17
Hello, this warn cmd i made it doesn't show the reason of the warn.
Is like: Admin user (irc) has warned playername (id) for:
Thank you.
Is like: Admin user (irc) has warned playername (id) for:
pawn Код:
IRCCMD:warn(botid, channel[], user[], host[], params[])
{
new ID; new reason[64]; new string[128]; new pname[24]; new string2[128];
if(IRC_IsOp(botid, channel, user))
{
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;
}