26.06.2011, 19:05
pawn Код:
dcmd_warn(playerid,params[])
{
new sname[MAX_PLAYER_NAME],
gname[MAX_PLAYER_NAME],
player,
reason,
str[128],
warn[MAX_PLAYERS];
if(Info[playerid][Level] < 2 && Info[playerid][TempLevel] < 2) SendClientMessage(playerid,-1,authorized);
if(sscanf(params,"us[128]",player,reason))return SendClientMessage(playerid,-1,"{FF7300}[SYSTEM]{D1D1D1} Usage: /warn [Player/Playerid] [Reason]");
if(!IsPlayerConnected(player))return SendClientMessage(playerid,-1,offline);
GetPlayerName(player,gname,sizeof(gname));
if(warn[player]<3)
{
GetPlayerName(playerid,sname,sizeof(sname));
warn[player] = warn[player] +1;
format(str,sizeof(str),"{FF7300}[SYSTEM]{D1D1D1} %s has been warned by %s [Reason:%s] [%i/3]",gname,sname,warn[player]);
SendClientMessageToAll(-1,str);
}
else
{
format(str,sizeof(str),"{FF7300}[SYSTEM]{D1D1D1} %s has been auto kicked [Reason: Exceeded max ammount of warnings] [3/3]",gname);
SendClientMessageToAll(-1,str);
Kick(player);
}
return 1;
}