Wanted list unkonw on dialog?
#1

pawn Код:
if(strcmp(cmd, "/wanted", true) == 0)
    {
        if(PlayerInfo[playerid][pMember] != 1)
        {
            SendClientMessage(playerid, COLOR_GRAD2, "    You are not a cop.");
            return 1;
        }
        new index;
        new stringx[456];
        format(stringx, sizeof(stringx), "{f48555}_______________________________\nListг urmгrire:");
        for (new i; i<=MAX_PLAYERS; i++)
        {
            new zone[MAX_ZONE_NAME];
            index ++;
            GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
            if(PlayerInfo[playerid][pIsolated] != 1)
            {
                format(stringx, 456, "%s\n{f48555}%d. %s (%d) {fec879}(W.%d){f48555} (%s)", stringx, index, GetName(i),i, PlayerInfo[i][pWanted],zone);
            }
            else
            {
                format(stringx, 456, "%s\n{f48555}%d. %s (%d) {9b0000}(IZOLAT){f48555} (%s)", stringx, index,GetName(i),i,zone);
            }
        }
        format(stringx,456, "%s\n{f48555}_______________________________", stringx);
        ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_MSGBOX, "{9E9E9E}Listг de urmгrire", stringx, "Done", "");
    }
result
.... why?
[img]
http://i.imgur.com/j3FOE69.jpg
[/img]
Reply
#2

make sure you are not using any type of other command processors if you are convert the command.

I'd recommend that you use zcmd it's more efficient and easy to use.
Reply
#3

A retrieved value from an array using an out of bound index is most likely invalid (causes that message to show up and terminates the command's process).

Also, check if the player id is valid, and switch to a newer/faster method of creating player loops (GetPlayerPoolSize() or foreach). And break the loop when it is necessary.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)