Dialog Help
#1

So, Basically. I have made a dialog showing all the hitman contracts so that you can click it and remove it. I cannot figure out a way to remove the contract from a player via the list. I need to be able to specify whose contract i am setting.
Reply
#2

You need to make an array that will store the IDs of all displayed contracts. That array has to be filled at the same time that the dialog is created.

So everytime you loop through a contract and add it to the dialog box, add it to the array. For example, make a global array:

pawn Код:
new contract_list[MAX_PLAYERS][MAX_CONTRACTS];
And in the code where you add all contracts to the array, just do something like:

pawn Код:
contract_list[playerid][i] = i;
Then under OnPlayerDialogResponse you can recall what has been stored in the array to get the contract ID in this manner:
pawn Код:
new tid = contract_list[playerid][listitem];
Then you do whatever you wanna do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)