Defines in Dialog title or body?
#1

Hey, Been some year since I left SAMP, But I'm back, creating a Roleplay server, But when I'm creating the login dialog, I want to be able to add a define called something like ServerName in the title,
PHP код:
#define ServerName New City Role Play 
PHP код:
ShowPlayerDialog(playeridD_LoginDIALOG_STYLE_INPUT"{82CAFF}" ServerName ""
Will it work like that?
Reply
#2

It will.
Cuz after u compile all #defines will be removed.

Cant explain good, cuz my english is not so good.
But answer: yes, it should work properly.
Reply
#3

Change to:
pawn Код:
#define ServerName "New City Role Play"
Reply
#4

This will give you an error:
Quote:

expected token: "-string end-", but found "-identifier-"

Since you don't have " " (double inverted commas) for enclosing the string whiling declaring the macro ServerName.

This would work:
pawn Код:
#define ServerName "New City Role Play"
Reply
#5

Thanks the two latest answers! Was just gonna post the string end error, But saw yours answers. Thanks, Both Repped.
Reply
#6

Got these errors now:
NCRP.pwn(89) : error 001: expected token: "-string end-", but found "-identifier-"
NCRP.pwn(89) : error 001: expected token: ";", but found "-string-"
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : error 001: expected token: ";", but found ")"
NCRP.pwn(89) : fatal error 107: too many error messages on one line


The line:

PHP код:
ShowPlayerDialog(playeridD_LoginDIALOG_STYLE_INPUT"{82CAFF}" ServerName"Welcome back to " ServerNameShorted ", " UserRPName(playerid" !\nInsert your password in order to start the fun!\n\nPassword Attempts left: " ,"Login","Quit"); 
Reply
#7

Removed, wrong point.
Reply
#8

The Defines works, But it's about the username and login attempts.
Reply
#9

Problem solved using format.
Reply
#10

Quote:
Originally Posted by Meller
Посмотреть сообщение
Got these errors now:
NCRP.pwn(89) : error 001: expected token: "-string end-", but found "-identifier-"
NCRP.pwn(89) : error 001: expected token: ";", but found "-string-"
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : warning 215: expression has no effect
NCRP.pwn(89) : error 001: expected token: ";", but found ")"
NCRP.pwn(89) : fatal error 107: too many error messages on one line


The line:

PHP код:
ShowPlayerDialog(playeridD_LoginDIALOG_STYLE_INPUT"{82CAFF}" ServerName"Welcome back to " ServerNameShorted ", " UserRPName(playerid" !\nInsert your password in order to start the fun!\n\nPassword Attempts left: " ,"Login","Quit"); 
Why don't you do a string, more easier, like that :
PHP код:
new string[300];
format(stringsizeof(string), {82CAFF"%s Welcome back to %s, %s !\nInsert your password in order to start the fun!\n\nPassword Attempts left: %i"ServerNameServerNameShortedUserRPName(playerid), AttemptsLeft);
ShowPlayerDialog(playeridD_LoginDIALOG_STYLE_INPUTstring ,"Login","Quit"); 
You errors message come from you put comma. I mean ShowPlayerDialog is like SendClientMessage/SendClientMessageToAll, you can't put parameter in your string.
I hope this helped you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)