Dialogs. - 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: Dialogs. (
/showthread.php?tid=583719)
Dialogs. -
CounterTDM - 30.07.2015
Issue Solved, thank you!
Re: Dialogs. -
Dan. - 30.07.2015
It could be that the dialog IDs intefere eachother. Can be that you have a dialog with ID 100 in 1 filterscript and a dialog with ID 100 in the other one. Try changing them.
Re: Dialogs. -
CounterTDM - 30.07.2015
Quote:
Originally Posted by Dan.
It could be that the dialog IDs intefere eachother. Can be that you have a dialog with ID 100 in 1 filterscript and a dialog with ID 100 in the other one. Try changing them.
|
Thanks for your input but that is not the case I dont think. You can see from the gun shop I am using ID '585'..
Код:
ShowPlayerDialog(playerid, 585, DIALOG_STYLE_TABLIST_HEADERS, "Gun Store (Weapons are lost on death)",
if(dialogid == 585)
This dialog ID is clearly not being used in the adminkod script, I am sure its something to do with the 'return 0 & return 1' bits. The actual gun shop script works fine, 100% so the fault is clearly in the admin plugin but for the life of me I cannot work out where.
Re: Dialogs. -
Dan. - 30.07.2015
Why are you returning 0 OnDialogResponse in the gun shop filterscript? Try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 585)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 200)
return SendClientMessage(playerid, 0xAA3333AA, "[Gun Store] You don't have enough money to buy this Weapon.");
GivePlayerMoney(playerid, -200);
GivePlayerWeapon(playerid, 23, 300);
SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon.");
}
case 1:
{
if(GetPlayerMoney(playerid) < 100)
return SendClientMessage(playerid, 0x009900FF, "[Gun Store] You don't have enough money to buy this Weapon.");
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 9, 300);
SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon.");
}
case 2:
{
if(GetPlayerMoney(playerid) < 1500)
return SendClientMessage(playerid, 0x009900FF, "[Gun Store] You don't have enough money to buy this Weapon.");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 16, 300);
SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon.");
}
}
}
}
return 1;
}
Re: Dialogs. -
CounterTDM - 30.07.2015
Quote:
Originally Posted by Dan.
Why are you returning 0 OnDialogResponse in the gun shop filterscript? Try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 585) { if(response) { switch(listitem) { case 0: { if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xAA3333AA, "[Gun Store] You don't have enough money to buy this Weapon."); GivePlayerMoney(playerid, -200); GivePlayerWeapon(playerid, 23, 300); SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon."); } case 1: { if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0x009900FF, "[Gun Store] You don't have enough money to buy this Weapon."); GivePlayerMoney(playerid, -100); GivePlayerWeapon(playerid, 9, 300); SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon."); } case 2: { if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, 0x009900FF, "[Gun Store] You don't have enough money to buy this Weapon."); GivePlayerMoney(playerid, -1500); GivePlayerWeapon(playerid, 16, 300); SendClientMessage(playerid, 0x009900FF, "[Gun Store] You have successfully purchased this Weapon."); } } } } return 1; }
|
Thank you, works fine now. +Rep