Dialog won't give player a gun - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog won't give player a gun (
/showthread.php?tid=482424)
Dialog won't give player a gun -
fanta291327 - 21.12.2013
Ok, So in my script I have a NG locker, I wanted to add more guns and I copied and pasted Mace but replaces the Gun IDS and the List item. I got 0 erros but when I went in game and went to get my new gun it didn't give it, Also there are weapons in between them and I know the List Item is correct 100%
Origional Code
Код:
if(listitem == 0) // Mace
{
if(PlayerInfo[playerid][pCash] < 0)
{
SendClientMessage(playerid, COLOR_GREY, " You cant afford that !");
TogglePlayerControllable(playerid,1);
return 1;
}
else
{
GivePlayerWeapon(playerid, 41, 999999);
PlayerInfo[playerid][pGun9] = 41;
TogglePlayerControllable(playerid,1);
}
}
Code after I edited it
Код:
if(listitem == 12) //Spistol
{
if(PlayerInfo[playerid][pCash] < 800)
{
SendClientMessage(playerid, COLOR_GREY, " You cant afford that !");
TogglePlayerControllable(playerid,1);
return 1;
}
else
{
GivePlayerWeapon(playerid, 23, 999999);
PlayerInfo[playerid][pGun2] = 23;
TogglePlayerControllable(playerid,1);
}
}
Re: Dialog won't give player a gun - Emmet_ - 21.12.2013
Mind showing the dialog that lists the weapons, please?
Re: Dialog won't give player a gun -
fanta291327 - 21.12.2013
ShowPlayerDialog(playerid,DIALOG_PG_WEAPONRY,DIALO G_STYLE_LIST,"Weapons","Mace \nNight Stick \nDeagle \nShotgun \nMP5 \nRifle \nM4 \nSpas12 \nSniper \nGrenades \nKevlar \nFirst Aid Kit \nSilenced \nRpg \nHSRocket \nSatchel \nNight Goggles\nThermal Goggles \nTearGas \nKnife ","Purchase","Cancel");
if(dialogid == DIALOG_PG_WEAPONRY) //Weapons
{
if(response)
{
if(listitem == 0) // Mace
Re: Dialog won't give player a gun -
ron_tim - 21.12.2013
Hmmm, I don't see why its doing that