Defines in Dialog title or body? -
Luicy. - 13.05.2016
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(playerid, D_Login, DIALOG_STYLE_INPUT, "{82CAFF}" ServerName "",
Will it work like that?
Re: Defines in Dialog title or body? -
BloodyRP - 13.05.2016
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.
Re: Defines in Dialog title or body? -
Konstantinos - 13.05.2016
Change to:
pawn Код:
#define ServerName "New City Role Play"
Re: Defines in Dialog title or body? -
Gammix - 13.05.2016
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"
Re: Defines in Dialog title or body? -
Luicy. - 13.05.2016
Thanks the two latest answers! Was just gonna post the string end error, But saw yours answers. Thanks, Both Repped.
Re: Defines in Dialog title or body? -
Luicy. - 13.05.2016
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(playerid, D_Login, DIALOG_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");
Re: Defines in Dialog title or body? -
Gammix - 13.05.2016
Removed, wrong point.
Re: Defines in Dialog title or body? -
Luicy. - 13.05.2016
The Defines works, But it's about the username and login attempts.
Re: Defines in Dialog title or body? -
Luicy. - 13.05.2016
Problem solved using format.
Re: Defines in Dialog title or body? -
Dayrion - 13.05.2016
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(playerid, D_Login, DIALOG_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(string, sizeof(string), {82CAFF} "%s Welcome back to %s, %s !\nInsert your password in order to start the fun!\n\nPassword Attempts left: %i", ServerName, ServerNameShorted, UserRPName(playerid), AttemptsLeft);
ShowPlayerDialog(playerid, D_Login, DIALOG_STYLE_INPUT, string ,"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.