#define
#1

Okay, so..
I'm having a little problem.
I was trying to do something like this:
#define SPAWN1_NAME Los Santos
#define SPAWN2_NAME Las Venturas

ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Spa wn"," SPAWN1_NAME \n SPAWN2_NAME","Ok","");

but it doesn't work.. instead of "Los Santos" or "Las Venturas" I got a dialog with "SPAWN1_NAME" and "SPAWN2_NAME".

Thanks for the help.
Reply
#2

pawn Code:
#define SPAWN1_NAME "Los Santos"
#define SPAWN2_NAME "Las Venturas"
I'm not sure that this would work, but try
Reply
#3

Because that isn't how it works it should be
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Spawn"," " + SPAWN1_NAME +"\n" + "" + SPAWN2_NAME....
Reply
#4

pawn Code:
#define SPAWN1_NAME "Los Santos"
#define SPAWN2_NAME "Las Venturas"

new string[128];
format(string, sizeof(string), "%s\n%s", SPAWN1_NAME, SPAWN2_NAME);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Spawn", string, "Ok", "");
That should work.
Reply
#5

Instead of what you have, try this:
pawn Code:
// top
#define SPAWN1_NAME "Los Santos"
#define SPAWN2_NAME "Las Venturas"
// ShowPlayerDialog function
ShowPlayerDialog(playerid, 1 DIALOG_STYLE_LIST, "Spawn", SPAWN1_NAME"\n"SPAWN2_NAME, "Ok", "");
Quote:
Originally Posted by mahdi499
View Post
Because that isn't how it works it should be
pawn Code:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Spawn"," " + SPAWN1_NAME +"\n" + "" + SPAWN2_NAME....
This isn't squirrel / javascript
Reply
#6

Not quite guys.

pawn Code:
#define SPAWN1_NAME "Los Santos"
#define SPAWN2_NAME "Las Venturas"

ShowPlayerDialog(0,1,DIALOG_STYLE_LIST,"Spawn","" SPAWN1_NAME "\n " SPAWN2_NAME "","Ok","");
#e: The better solution is @up
Reply
#7

Quote:
Originally Posted by Kikito
View Post

This isn't squirrel / javascript
yeah i realized wrong scripting language,sorry scumbag brain
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)