SA-MP Forums Archive
Define - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Define (/showthread.php?tid=278519)



Define - Wesley221 - 22.08.2011

Hey guys,

Im making a dialog where you can buy guns. Now im trying to make dynamic prices behind the weapon like this:
pawn Code:
ShowPlayerDialog(playerid, HANDWEP, DIALOG_STYLE_LIST, "Choose the weapon you want", "Knife($KNIFE) \nBaseball Bat($BASEBALL) \nShovel($SHOVEL) \nKatana($KATANA) \nChainsaw($CHAINSAW)", "Buy", "Back");
The ($KNIFE) is a define, just like all the other things. Somehow, it shows ingame just like this in the dialog:
Knife($KNIFE)
It should be "Knife($500)". I got all the defines right, and i dont see the problem here. Can anyone help me with this?

Weapon prices defines:
pawn Code:
#define KNIFE               500
#define BASEBALL            800
#define SHOVEL              900
#define KATANA              1000
#define CHAINSAW            1500
~Wesley


Re: Define - RyDeR` - 22.08.2011

Show your dialogs.


Re: Define - Wesley221 - 22.08.2011

Well, its with all the dialogs the same. In the first post theres a example of one, defines are down, and it shows like:
Knife($KNIFE) in the dialog (ingame)


Re: Define - RyDeR` - 22.08.2011

Silly me - should've taken a better look at the topic. Try this:
pawn Code:
ShowPlayerDialog(playerid, HANDWEP, DIALOG_STYLE_LIST, "Choose the weapon you want", "Knife($" #KNIFE ") \nBaseball Bat($" #BASEBALL ") \nShovel($" #SHOVEL ") \nKatana($" #KATANA ") \nChainsaw($" #CHAINSAW ")", "Buy", "Back");



Re: Define - Wesley221 - 22.08.2011

Yep works, thanks