30.10.2013, 20:35
You can't just copy/past. You have to edit it to your own gamemode. Anyway, try this:
At the top of your script under includes/defines:
Then this is your command. put this out of any callback (public things):
At the top of your script under includes/defines:
pawn Код:
new Warnings[MAX_PLAYERS]
pawn Код:
CMD:warn(playerid, params[])
{
new targetid; new string[150]; reason[50];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, -1, "You aren't admin !");
if(!IsPlayerConnected(targetid))return SendClientMessage(playerid, -1, "Invalid player id!");
if(sscanf(params, "us", targetid, reason))return SendClientMessage(playerid, -1, "usage: /warn [playerid] [reason]");
Warnings[targetid] ++;
if(Warnings[targetid] == 3)
{
Kick(targetid);
format(string, sizeof(string), "%s has been kicked for earning 3 warnings !", targetid);
SendClientMessageToAll(-1, string);
}
return 1;
}