31.01.2011, 13:59
Use one wString not 8!
top
connect/disconnect
top
pawn Код:
new warnings[YOUR_MAX_PLAYERS];
pawn Код:
warnings[playerid]=0;
pawn Код:
dcmd_warn(playerid, params[])
{
new warnID, Reason[128];
if(Player[playerid][admin] < 1) return 0;
if(sscanf(params,"us",warnID, Reason)) SendClientMessage(playerid, COLOR_GREY, "|| Usage: /warn [playerid] [reason] ||");
else if(!IsPlayerConnected(warnID)) SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID!");
else{
new wString[128],Name[MAX_PLAYER_NAME],aname[MAX_PLAYER_NAME];
warnings[warnID]++;
if(0 < warnings[warnID] < 3) {
GetPlayerName(warnID,Name,MAX_PLAYER_NAME);
GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
format(wString,sizeof(wString), "**(ADMIN WARN)** %s(%d) %s",Name, warnID, Reason);
SendClientMessageToAll(gold, wString);
format(wString,sizeof(wString), "You Have WARN %s(%d) For Reason: %s",Name, warnID,Reason);
SendClientMessage(playerid,COLOR_GREEN, wString);
format(wString,sizeof(wString), "You Have Been WARNED By Admin For Reason: %s",Reason);
SendClientMessage(warnID, f, wString);
format(wString,sizeof(wString), "Admin %s(%d) Has WARN %s(%d) For Reason: %s",aname,playerid,Name,warnID,Reason);
SendAdminMessage(gold, wString);
SaveToFile("Warns", wString);
return 1;
}
format(wString,sizeof(wString), "**(AUTO KICK)** %s(%d) %s",Name, warnID, Reason);
SendClientMessageToAll(gold, wString);
format(wString,sizeof(wString), "You Have KICK %s(%d) For Reason: %s",Name, warnID,Reason);
SendClientMessage(playerid,COLOR_GREEN, wString);
format(wString,sizeof(wString), "You Have Been AUTO KICK By Server For Reason: %s",Reason);
SendClientMessage(warnID, f, wString);
format(wString,sizeof(wString), "Admin %s(%d) Has KICK %s(%d) For Reason: %s",aname,playerid,Name,warnID,Reason);
SendAdminMessage(gold, wString);
SaveToFile("Auto KICKS", wString);
Kick(warnID);
}
return 1;
}