SA-MP Forums Archive
wanted - 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)
+--- Thread: wanted (/showthread.php?tid=320968)



wanted - trulis - 25.02.2012

My /wanted command doesn't work properly, it doesn't show the players with w1.

pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gTeam[playerid] == 2 || IsACop(playerid))
            {
                new x;
                SendClientMessage(playerid, COLOR_1RED, "|____Current Wanted List____|");
                for(new i=0; i < MAX_PLAYERS; i++) {
                    if(IsPlayerConnected(i))
                    {
                        if(WantedLevel[i] > 0)
                        {
                            GetPlayerName(i, giveplayer, sizeof(giveplayer));
                            format(string, sizeof(string), "%s%s:[WantedLevel:%d]", string,giveplayer,WantedLevel[i]);
                            x++;
                            if(x > 3) {
                                SendClientMessage(playerid, COLOR_WHITE, string);
                                x = 0;
                                format(string, sizeof(string), "");
                            } else {
                                format(string, sizeof(string), "%s, ", string);
                            }
                        }
                    }
                }
                if(x <= 3 && x > 0) {
                    string[strlen(string)-2] = '.';
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You're not a Cop / Serviciu Roman de Investigatii / Armata Romana !");
            }
        }//not connected
        return 1;



Re: wanted - trulis - 27.02.2012

Bumb, help please!


Re: wanted - Madd Kat - 27.02.2012

Do you get any errors?
Does it show people with wanted 2,3,4,5,6?


Re: wanted - trulis - 27.02.2012

I don't get any errors and yes it shows the players with wanted 2,3,4,5,6,7,8,9 and 10, but not those with wanted 1.


Re: wanted - Madd Kat - 27.02.2012

Try this

pawn Код:
* * * * * * * * * * * * if(WantedLevel[i] != 0)