SA-MP Forums Archive
Need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Client Support (https://sampforum.blast.hk/forumdisplay.php?fid=16)
+--- Thread: Need Help (/showthread.php?tid=366748)



Need Help - Rayansh - 07.08.2012

I wan't warn command plz anyone give me ??/


Re: Need Help - [EuG]ZeRoGoD - 07.08.2012

Try this
Код:
CMD:warn(playerid, params[])
{
if(AdminLevel[playerid] == 2)  return SendClientMessage(playerid,COLOR_BLUE,"You have to be level 1 to use that command!");
new warnID;
if(sscanf(params, "u", warnID))return SendClientMessage(playerid, COLOR_WHITE, "[INFO]: /warn [playerid]");
else
{
new wString[22];
SetPVarInt(warnID, "PlayerWarnings", GetPVarInt(playerid, "PlayerWarnings")+1);
format(wString, sizeof(wString), "You have been warned! [%i/5]", GetPVarInt(playerid, "PlayerWarnings"));
SendClientMessage(warnID, COLOR_RED, wString);
if(GetPVarInt(playerid, "PlayerWarnings")>=5)Kick(warnID);
}
return 1;
}