25.11.2011, 01:20
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:
OnDialogResponse:
Your help would be greatly appreciated. +1
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;
}
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