1. on the OnPlayerDeath callback, assign the "playerid" to a variable you've created ontop of your script, example:
new SpecificPlayer; then in the callback: playerid = SpecificPlayer;
2. Find out how many guns he has, and store them into variables using the GetPlayerWeaponData function and global variables (variables on top of your script) on the same callback
3. on the /searchbody command (or whatever it is the command) use the if/else if structure (or the case structure, it's way more efficient but this one is okay too) to find out how many guns he has and what are those guns, and just simply create dialogs with the same number and type of guns you have in the variables, this is tricky indeed although it works.
small example:
pawn Код:
// the variable for number of guns will be : NumOfGuns, and the variables for gun types would be gun1, gun2.....gun13.
// this is in the search body command
if(NumOfGuns == 1)
{
// make the dialog here with only one line of text saying "First gun"
}
else if(NumOfGuns == 2)
{
// make the dialog here with only two lines of text saying "First gun\nSecond Gun"
}
// and so on, then give them the gun once they click on it (use the OnDialogResponse callback for that)
It is infact complicated, and I may haven't been that great in explaining it here, but it would work.
If you're new to scripting I suggest you don't get your hopes up alot, good luck.