[HELP ME] /warn command
#8

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:
pawn Код:
new Warnings[MAX_PLAYERS]
Then this is your command. put this out of any callback (public things):
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;
}
Reply


Messages In This Thread
[HELP ME] /warn command - by jdog105 - 28.10.2013, 23:01
Re: [HELP ME] /warn command - by Patrick - 28.10.2013, 23:07
Re: [HELP ME] /warn command - by DStreet - 28.10.2013, 23:20
Re: [HELP ME] /warn command - by jdog105 - 28.10.2013, 23:30
Re: [HELP ME] /warn command - by jdog105 - 28.10.2013, 23:36
Re: [HELP ME] /warn command - by SAMProductions - 29.10.2013, 02:45
Re: [HELP ME] /warn command - by jdog105 - 30.10.2013, 18:41
Re: [HELP ME] /warn command - by Areax - 30.10.2013, 20:35
Re: [HELP ME] /warn command - by KingHual - 30.10.2013, 20:42
Re: [HELP ME] /warn command - by AnonScripter - 30.10.2013, 23:14

Forum Jump:


Users browsing this thread: 3 Guest(s)