03.01.2019, 22:33
Quote:
If it's ever not conveniently formatted to use with sscanf, you could always do something like:
pawn Code:
pawn Code:
We're using the listitem the player would be at in OnDialogResponse and setting their ID through the PVar. listitems start at 0 and as does your countPlayers variable. It's pretty simple and self explanatory but if you don't understand, let me know and I'll explain further. |
I should do it like this:
PHP Code:
// Somewhere above your script (global variable), not inside any functions:
new dialogPlayerStatsList[MAX_PLAYERS][MAX_PLAYERS];
// Inside your foreach loop where you generate the list of players:
foreach(Character, i){
if(PlayerInQueue[i] == true){
format(players, sizeof(players), "%s", GetPlayerName(i));
strcat(string, "\n");
strcat(string, players);
dialogPlayerStatsList[playerid][countPlayers] = i;
countPlayers++;
}
}
// OnDialogResponse:
if(dialogid == 34){
if(response){
// Selected playerid:
new selected_playerid = dialogPlayerStatsList[playerid][listitem];
GivePlayerMoney(selected_playerid, 1337); // Give selected player from list money (example)
}
}