ShowPlayerDialog
#1

Getting a heap of messages with this ShowPlayerDialog line for some odd reason while trying to make a login system off this tutorial: https://sampforum.blast.hk/showthread.php?tid=273088

Код:
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : warning 215: expression has no effect
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : error 001: expected token: ";", but found "-string-"
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : warning 215: expression has no effect
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Leigh\Documents\GTA SA\samp server\gamemodes\cnc.pwn(191) : fatal error 107: too many error messages on one line
This is the line:

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COLOR_WHITE"Login", ""COLOR_WHITE"Type your password below to login.", "Login", "Quit");
Here are the defines too if you need them:

Код:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define PATH "/Users/%s.ini"

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_RED 0xF81414AA
#define COLOR_GREEN 0x00FF22AA
#define COLOR_LIGHTBLUE 0x00CED1AA
Any help would be much appreciated and will be given +rep
Reply
#2

pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "~w~Login", "~w~Type your password below to login.", "Login", "Quit");
Try this.

Or this:
pawn Код:
new Title[50], Message[128];
format(Title, 50, "{%s}Login", COLOR_WHITE);
format(Message, 128, "{%s}Type your password below to login.", COLOR_WHITE);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, Title, Message, "Login", "Quit");
You were opening a string and closing it immediately afterwards using "".
Then you defined the color outside the string and start a new string.
Reply
#3

I doubt that you can use colors like this. The acceptable format is {FFFFFF} and I don't even know what you will get by formating it like '{%s}', when COLOR_WHITE is not even a string. You could define same color again, but for strings, for example:
pawn Код:
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_WHITE_S "{FFFFFF}"
So then you can use like this:
pawn Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, COLOR_WHITE_S"Login", COLOR_WHITE_S"Type your password below to login.", "Login", "Quit");
Reply
#4

Fixed it, turns out that the tutorial was unclear or outdated, I just removed the colors completely and it worked.

+rep to both of you for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)