09.03.2012, 20:00
well i recommand zcmd because its the easiest.
pawn Код:
dcmd_warn(playerid, params[])
{
new id,IDWarn[MAX_PLAYERS],name[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME];
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /warn [playerid / partofname]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is not connected");
GetPlayerName(playerid,name,24);
GetPlayerName(id,pname,24);
if(IDWarn[ID] == 0)
{
format(params,sizeof(params),"Admin %s has warned you (1/3)",name);
SendClientMessage(id,0xFF0000FF,params);
format(params,sizeof(params),"You have warned %s (1/3)",pname);
SendClientMessage(playerid,0xFF0000FF,params);
IDWarn[ID] = 1;
}
else if(IDWarn[ID] == 1)
{
format(params,sizeof(params),"Admin %s has warned you (2/3)",name);
SendClientMessage(id,0xFF0000FF,params);
format(params,sizeof(params),"You have warned %s (2/3)",pname);
SendClientMessage(playerid,0xFF0000FF,params);
IDWarn[ID] = 2;
}
else if(IDWarn[ID] == 2)
{
format(params,sizeof(params),"Admin %s has warned you (3/3)",name);
SendClientMessage(id,0xFF0000FF,params);
format(params,sizeof(params),"You have warned %s (3/3)",pname);
SendClientMessage(playerid,0xFF0000FF,params);
IDWarn[ID] = 3;
Kick(id);
}
return 1;
}