22.07.2011, 13:41
pawn Код:
CMD:vipgunsmenu(playerid, params[])
{
if(IsPlayerVip[playerid] >= 1)
{
ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns", "Shawn-off\nTec9", "Accept", "Cancel");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000, "You can not use this command. Reason: You are not VIP player.");
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(vipguns) // <------------ here is the problem, replace it with 'switch(dialogid)'
{
case 1://<----------------- here aswell, replace it with 'case vipguns'
{
if(!response)
{
SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
return 1;
}
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 36, 500);
}
case 1:
{
GivePlayerWeapon(playerid, 26, 500);
}
}
}
}
return 1;
}
for more info https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog