Strings on a dialog.
#1

Hello, i'm trying to put a string in my dialog, but i get errors :S

pawn Code:
error 001: expected token: "]", but found ")"
warning 219: local variable "string" shadows a variable at a preceding level
error 001: expected token: ";", but found "-identifier-"
warning 202: number of arguments does not match definition
error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
They are the errors.

_________________

This is the line i'm trying to put the string on >_<
pawn Code:
case 2: // Login
        {
            new string[128]
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login","{FFFFFF}Welcome to {0800FF}Test Server Roleplay %s.\n\n{FFFFFF}That name is {00C71B}registered.{FFFFFF} please enter your password below.", "Login", "Quit", RPN(playerid);
RPN means roleplay name by the way ;p
Reply
#2

pawn Code:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login","{FFFFFF}Welcome to {0800FF}Test Server Roleplay %s.\n\n{FFFFFF}That name is {00C71B}registered.{FFFFFF} please enter your password below.", "Login", "Quit", RPN(playerid));
Delete new string[128]; not need for it
Reply
#3

Hello!, I've added updated the line with what you've put, but i've got a warning on it now?

pawn Code:
warning 202: number of arguments does not match definition
when I go ingame it just says %s and not a name

Is there a way to fix this?

Thank you
Reply
#4

pawn Code:
format(string,sizeof(string),"{4F00ED}Login","{FFFFFF}Welcome to {0800FF}Test Server Roleplay %s.\n\n{FFFFFF}That name is {00C71B}registered.{FFFFFF} please enter your password below.",RPN(playerid));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login",string, "Login", "Quit");
Reply
#5

Now I have 4 errors
pawn Code:
error 014: invalid statement; not in switch
warning 215: expression has no effect
error 001: expected token: ";", but found ":"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
All on the line:
pawn Code:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login",string, "Login", "Quit");
Reply
#6

AHHH! wait, i think i've just failed at pasting it >_<
Reply
#7

you are missed } some where or you missed place to put code in.
Reply
#8

Ahh, i see.

When i load it up ingame it just says Login then the box and the Login and Quit, noany name
Reply
#9

pawn Code:
new mylongstring[256];
format(mylongstring,sizeof(mylongstring),"{FFFFFF}Welcome to {0800FF}Test Server Roleplay %s.\n\n{FFFFFF}That name is {00C71B}registered.{FFFFFF} please enter your password below.",RPN(playerid));
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login",mylongstring, "Login", "Quit");
Reply
#10

Still nothing,

It doesn't show any of the text from the first line.

Only:
pawn Code:
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_PASSWORD, "{4F00ED}Login",mylongstring, "Login", "Quit");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)