23.06.2016, 00:44
I'm making a tokens FS and eveyrhting work correctly just.. the dialog in the last of the script won't open IG... plz help me in this
http://pastebin.com/MRMybDeM
http://pastebin.com/MRMybDeM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FIRSTMENU)
{
if(response)
{
if(listitem == 0) // Weapons
{
ShowPlayerDialog(playerid,FIRSTMENU+2,DIALOG_STYLE_LIST,
"Regular Players Lounge",
"MP5\nCombat Shotgun\nDesert Eagle\nM4\nAK-47\nBack",
"Select", "Exit");
}
}
}
if(dialogid == FIRSTMENU+2) // Weapons
{
if(response)
{
if(listitem == 0) // MP5
{
new ammo = GetPlayerAmmo(playerid);
if(ammo >=600)
{
SendClientMessage(playerid, COLOR_GREY,
"Sorry you have all the free ammo we can give you for now");
}
if(GetPlayerMoney(playerid) < 15000)
{
SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
}
else
GivePlayerMoney(playerid, -15000);
GivePlayerWeapon(playerid, 29, 200);
}
if(listitem == 1) // Chainsaw
{
new ammo = GetPlayerAmmo(playerid);
if(ammo >400)
{
SendClientMessage(playerid, COLOR_GREY,
"Sorry you have all the free ammo we can give you for now");
}
if(GetPlayerMoney(playerid) < 8000)
{
SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
}
else
GivePlayerWeapon(playerid,25 ,25);
GivePlayerMoney(playerid, -8000);
}
}
}
return 1;
}
#define FIRSTMENU 990
#define SECONDMENU 991
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == FIRSTMENU)
{
if(reponse)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, SECONDMENU, DIALOG_STYLE_LIST,
"Regular Players Lounge",
"MP5\nCombat Shotgun\nDesert Eagle\nM4\nAK-47\nBack",
"Select", "Exit");
}
}
}
if(dialogid == SECONDMENU)
{
if(reponse)
{
switch(listitem)
{
case 0:
{
new ammo = GetPlayerAmmo(playerid);
if(ammo >= 600) return SendClientMessage(playerid, COLOR_GREY, "Sorry you have all the free ammo we can give you for now");
if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
GivePlayerMoney(playerid, -15000);
GivePlayerWeapon(playerid, 29, 200);
return 1;
}
case 1:
{
new ammo = GetPlayerAmmo(playerid);
if(ammo > 400) return SendClientMessage(playerid, COLOR_GREY, "Sorry you have all the free ammo we can give you for now");
if(GetPlayerMoney(playerid) < 8000) return SendClientMessage(playerid, COLOR_GREY,"* You cannot afford this!");
GivePlayerWeapon(playerid,25 ,25);
GivePlayerMoney(playerid, -8000);
return 1;
}
default : return 1;
}
return 1;
}
}
return 1;
}
COMMAND:buyweapons(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 3, 1720.9337, -1629.0479, 20.2135))
{
ShowPlayerDialog(playerid, FIRSTMENU, DIALOG_STYLE_LIST,
"Weapons List",
"MP5 5 Tokens\nShotgun 5 Tokens\nDesert Eagle 5 Tokens\nCombat Shotgun5 Tokens\nM4 5 Tokens\nAK-47 5 Tokens\nSniper Rifle 5 Tokens",
"Select", "Exit");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You Are not at the weapon point!");
}
}
return 1;
}