Dialog not appearing -
Oh - 25.11.2011
So we've been working on this command so you can buy weapons and for some reason it's not working correctly does anyone see the problem?
OnPlayerCommandText:
pawn Код:
if(strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1480.82, -1789.80, 156.75))
{
ShowPlayerDialog(playerid, 99999, DIALOG_STYLE_LIST, "Weapon Store", "Melee\nPistols\nClose Range\nAssault\nExplosives", "Select", "Cancel");
}
else
{
SendClientMessage(playerid, BLANCO, "You are not at any weapons store!");
}
return 1;
}
OnDialogResponse:
pawn Код:
if(dialogid == 99999)
{
if(response == 1)
{
// switch(listitem)
// {
if(listitem == 0)
{
ShowPlayerDialog(playerid, 99998, DIALOG_STYLE_LIST, "Melee Weapons", "Golf Club (3 Chips)\nNite Stick (7 Chips)\nKnife (10 Chips)\nBaseball Bat (12 Chips)\nShovel (15 Chips)\nPool Cue (17 Chips)\nKatana (20 Chips)", "Purchase", "Cancel");
}
if(listitem == 1)
{
ShowPlayerDialog(playerid, 99997, DIALOG_STYLE_LIST, "Pistols", "9mm (15 Chips)\nDesert Eagle (20 Chips)", "Purchase", "Cancel");
}
if(listitem == 2)
{
ShowPlayerDialog(playerid, 99996, DIALOG_STYLE_LIST, "Close Range Weapons", "Shotgun (20 Chips)\nSawn-off Shotgun (40 Chips)\nCombat Shotgun (60 Chips)\nFlamethrower (300 Chips)", "Purchase", "Cancel");
}
if(listitem == 3)
{
ShowPlayerDialog(playerid, 99995, DIALOG_STYLE_LIST, "Assault Weapons", "MP5 (20 Chips)\nAK47 (60 Chips)\nM4 (75 Chips)", "Purchase", "Cancel");
}
if(listitem == 4)
{
ShowPlayerDialog(playerid, 99994, DIALOG_STYLE_LIST, "Explosives", "Molotov (120 Chips)\nGrenades (300 Chips)", "Purchase", "Cancel");
}
// }
}
return 1;
}
Your help would be greatly appreciated. +1
Re: Dialog not appearing -
serman - 25.11.2011
Код:
if(dialogid == 99999)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 99998, DIALOG_STYLE_LIST, "Melee Weapons", "Golf Club (3 Chips)\nNite Stick (7 Chips)\nKnife (10 Chips)\nBaseball Bat (12 Chips)\nShovel (15 Chips)\nPool Cue (17 Chips)\nKatana (20 Chips)", "Purchase", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 99997, DIALOG_STYLE_LIST, "Pistols", "9mm (15 Chips)\nDesert Eagle (20 Chips)", "Purchase", "Cancel");
}
case 2:
{
ShowPlayerDialog(playerid, 99996, DIALOG_STYLE_LIST, "Close Range Weapons", "Shotgun (20 Chips)\nSawn-off Shotgun (40 Chips)\nCombat Shotgun (60 Chips)\nFlamethrower (300 Chips)", "Purchase", "Cancel");
}
case 3:
{
ShowPlayerDialog(playerid, 99995, DIALOG_STYLE_LIST, "Assault Weapons", "MP5 (20 Chips)\nAK47 (60 Chips)\nM4 (75 Chips)", "Purchase", "Cancel");
}
case 4:
{
ShowPlayerDialog(playerid, 99994, DIALOG_STYLE_LIST, "Explosives", "Molotov (120 Chips)\nGrenades (300 Chips)", "Purchase", "Cancel");
}
}
}
}
maybe it will be work,,, try it
Re: Dialog not appearing -
Oh - 25.11.2011
Yeah we tried that, that wasn't it either.
Re: Dialog not appearing -
=WoR=Varth - 25.11.2011
Debug your code
pawn Код:
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 99998, DIALOG_STYLE_LIST, "Melee Weapons", "Golf Club (3 Chips)\nNite Stick (7 Chips)\nKnife (10 Chips)\nBaseball Bat (12 Chips)\nShovel (15 Chips)\nPool Cue (17 Chips)\nKatana (20 Chips)", "Purchase", "Cancel");
print("Called");
}
Re: Dialog not appearing -
Oh - 25.11.2011
It seems nothing got called :/ what do you guys think would be the issue?
I've done a printf for the command to and the command works it's just not following through with
ShowPlayerDialog(playerid, 33333, DIALOG_STYLE_LIST, "Weapon Store", "Melee\nPistols\nClose Range\nAssault\nExplosives", "Select", "Cancel");
So.
Re: Dialog not appearing -
CSSI - 25.11.2011
It's not showing coz the dialog id is not valid. Max dialogid is 32767
Re: Dialog not appearing -
Mr_Scripter - 25.11.2011
if so.. use this
pawn Код:
if(strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1480.82, -1789.80, 156.75))
{
ShowPlayerDialog(playerid, 32767, DIALOG_STYLE_LIST, "Weapon Store", "Melee\nPistols\nClose Range\nAssault\nExplosives", "Select", "Cancel");
}
else
{
SendClientMessage(playerid, BLANCO, "You are not at any weapons store!");
}
return 1;
}
pawn Код:
if(dialogid == 32767)
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 32766, DIALOG_STYLE_LIST, "Melee Weapons", "Golf Club (3 Chips)\nNite Stick (7 Chips)\nKnife (10 Chips)\nBaseball Bat (12 Chips)\nShovel (15 Chips)\nPool Cue (17 Chips)\nKatana (20 Chips)", "Purchase", "Cancel");
}
case 1:
{
ShowPlayerDialog(playerid, 32765, DIALOG_STYLE_LIST, "Pistols", "9mm (15 Chips)\nDesert Eagle (20 Chips)", "Purchase", "Cancel");
}
case 2:
{
ShowPlayerDialog(playerid, 32764, DIALOG_STYLE_LIST, "Close Range Weapons", "Shotgun (20 Chips)\nSawn-off Shotgun (40 Chips)\nCombat Shotgun (60 Chips)\nFlamethrower (300 Chips)", "Purchase", "Cancel");
}
case 3:
{
ShowPlayerDialog(playerid, 32763, DIALOG_STYLE_LIST, "Assault Weapons", "MP5 (20 Chips)\nAK47 (60 Chips)\nM4 (75 Chips)", "Purchase", "Cancel");
}
case 4:
{
ShowPlayerDialog(playerid, 32762, DIALOG_STYLE_LIST, "Explosives", "Molotov (120 Chips)\nGrenades (300 Chips)", "Purchase", "Cancel");
}
}
}
}
Re: Dialog not appearing -
Oh - 26.11.2011
Thanks you two +rep for both of you. Got it working now thanks.