14.03.2014, 10:13
It seems like you really don't understand it so here you go.
Now down here is the OndialogResponce code
pawn Код:
//Add this at the top of your script
#define VIP_DIALOG 75 //Just making a random number so it doesn't corasopnd with other dialogs you may have.
//Your basic command
CMD:viplocker(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1416.7363, -1680.0768, 13.5469))
{
ShowPlayerDialog(playerid, VIP_DIALOG, DIALOG_STYLE_LIST, "VIP Locker", "VIP Heal\nVIP Armor\nVIP Weapons", "Select", "Cancel"); //showing the locker menu.
}
return SendClientMessage(playerid,-1, "Error: You're not near the locker."); //The fail message
return 1;
}
Now down here is the OndialogResponce code
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == VIP_DIALOG)
{
if(response) // If they clicked 'Yes' or pressed enter
{
SendClientMessage(playerid, COLOR_GREEN, "You've healed yourself");
SetPlayerHealth(playerid, 100.0);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "You've added VIP armor to yourself");
SetPlayerArmour(playerid, 100.0);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "You've got a weaponset");
GivePlayerWeapon(playerid, 31, 100); //M4 with 100 bullts
//Add the rest of your guns here blah blah
}
return 1;
}
return 0;
}