#1

Код HTML:
if(strcmp(cmd, "/wanted", true) == 0) 
    { 
        if(IsPlayerConnected(playerid)) 
           { 
            if(IsACop(playerid)) 
            { 
                new jobs[254]; 
                new string[1024];
                new count=0;
                for(new i=0; i < MAX_PLAYERS; i++) 
                { 
                    if(IsPlayerConnected(i)) 
                    { 
                        if(WantedLevel[i] > 0) 
                        { 
                            GetPlayerName(i, giveplayer, sizeof(giveplayer));
                            if(count == 0)
                            { 
                                format(jobs, sizeof(jobs), "%s - Wanted Level {FF0000}%d\n{FFFFFF}",giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
                            }
                            else if(count > 0)
                            {
                                format(jobs, sizeof(jobs), "%s%s - Wanted Level {FF0000}%d\n{FFFFFF}",string,giveplayer,WantedLevel[i]); //you don't need a big size for this thinggy
                            }
                            strcat(string,jobs);
                            count++;
                        } 
                    } 
                } 
                ShowPlayerDialog(playerid,153,DIALOG_STYLE_LIST,"Suspecti cu wanted",string,"Ok", ""); 
            } 
            else 
            { 
                SendClientMessage(playerid, COLOR_GREY, "* Nu esti politist!"); 
            } 
        }//not connected 
        return 1; 
    }
I wish that when you click on one who has wanted to put a checkpoint on the player that clicked. The problem is I do not know how can I find the id I clicked player
Reply
#2

Create something like a global array for each player:
pawn Код:
new DialogInputs[MAX_PLAYERS][MAX_PLAYERS];
Inside your command where you check whether the wanted level is greater than ZERO do something like this:
pawn Код:
DialogInputs[playerid][count] = i;
And when responding to the dialog, simply do;
pawn Код:
new clickedID = DialogInputs[playerid][listitem];
This must work as i'm using this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)