SA-MP Forums Archive
Set Wanted cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Set Wanted cmd (/showthread.php?tid=276022)



Set Wanted cmd - muhib777 - 12.08.2011

Sorry I have no clue how to make it searched for it too didn't find it.
I want to make a cmd where you can set someones wanted level by /setwanted.
How can I do this?


Re: Set Wanted cmd - Wesley221 - 12.08.2011

pawn Код:
COMMAND:setwanted(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You need to be admin to use this command!");
    new Target, Level;
    if(!sscanf(params, "ui", Target, Level))
    {
        new string[128], string1[128], myname[24], targetname[24];
        GetPlayerName(playerid, myname, 24);GetPlayerName(Target, targetname, 24);
        SetPlayerWantedLevel(Target, Level);
        format(string, sizeof string, "%s changed your wanted level. ", myname);
        format(string1, sizeof string1, "You changed %s's wanted level. ", targetname);
        SendClientMessage(playerid, -1, string1);
        SendClientMessage(Target, -1, string);
    } else return SendClientMessage(playerid, -1, "Usage: /setwanted [playerid] [wanted level]");
    return 1;
}
You will need zcmd & sscanf for this.