ShowPlayerDialog Help Error! +REP
#1

Hello,
I made a dialog that has a list of my servers commands. When i add one to the list, it gives me this ..
Код:
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(31) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(135) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(175) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(283) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(340) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(382) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\ladmin.inc(26) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2513) : error 075: input line too long (after substitutions)
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2514) : error 035: argument type mismatch (argument 3)
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2514) : error 017: undefined symbol "FF0000"
Then, here is the command im using ..
Код:
if(strcmp(cmdtext, "/cmds", true)==0 || strcmp("/commands",cmdtext,true)==0)
{
		ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX, "Server Commands", "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle ", "OK", "");
		return 1;
}
Is there a limit of adding?
Reply
#2

Yes, but you haven't passed it.

You're missing arguments in the ShowPlayerDialog call. ShowPlayerDialog parameters are:
pawn Код:
(playerid, dialogid, style, caption[], info[], button1[], button2[])
and you missed the dialogid param.

And for the input too long error you gotta split your ShowPlayerDialog call into two lines:

pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,
"Server Commands", "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle ", "OK", "");
Reply
#3

Yes, you must use strcat for this
pawn Код:
new string2[512] = "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed";
strcat(string2,"\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}");
//and so on
Reply
#4

Sphinx, I dont understand what you did on the "Split Your dialog call into two lines"
Sorry guys in trying to learn more in PAWNO.
Reply
#5

It's simple, you had your dialog call in one line like this:
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"Server Commands", "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle ", "OK", "");
I just came after that comma after DIALOG_STYLE_MSGBOX and pressed enter to move the code after it to a new line
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,/* Pressed Enter here */"Server Commands",  ... etc
Final code:
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,
"Server Commands", "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle ", "OK", "");
Reply
#6

Okay, When i did that i got more errors.
I did that and came up with this ..
Quote:

if(strcmp(cmdtext, "/cmds", true)==0 || strcmp("/commands",cmdtext,true)==0)
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,
"Server Commands", "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle ", "OK", "");
return 1;
}

Then the errors were,
Quote:

C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(31) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(135) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(175) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(283) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(340) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(382) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\ladmin.inc(26) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : warning 217: loose indentation
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2517) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(252 : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2530) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2532) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2536) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(253 : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2540) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2544) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2546) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(254 : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2557) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2559) : error 054: unmatched closing brace ("}")
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2560) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2562) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2563) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2565) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2571) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2576) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2582) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2584) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2586) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2587) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2589) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2595) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2600) : error 010: invalid function or declaration
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2606) : error 010: invalid function or declaration

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

Reply
#7

Missing a bracket after the if statement?

pawn Код:
if(strcmp(cmdtext, "/cmds", true)==0 || strcmp("/commands",cmdtext,true)==0)
{ // < this
Reply
#8

Yes! Thanks Sphinx! Works! +REP BRO.
Thank you!
Reply
#9

Actually, It didnt -.-, When i add something else like. \n/Day & /Night it gives me 5 errors.

Quote:

C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(31) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(135) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(175) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(283) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(340) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dutils.inc(382) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\pawno\include\ladmin.inc(26) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2514) : error 075: input line too long (after substitutions)
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : error 017: undefined symbol "FF0000"
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : warning 217: loose indentation
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : error 029: invalid expression, assumed zero
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : error 017: undefined symbol "Teles"
C:\Users\Dario\Desktop\SAMP Server\gamemodes\driftpro.pwn(2515) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#10

Just found a fix for all problems like this

Change your code to
pawn Код:
if(strcmp(cmdtext, "/cmds", true)==0 || strcmp("/commands",cmdtext,true)==0)
{
        new str[] = "{FF0000}/Teles {FFFF00}For Teleports\n{FF0000}/Help {FFFF00}If Help Is Needed\n{FF0000}/Report {FFFF00}If You Saw A Hacker\n{FF0000}/Wheelpower {FFFF00}For Cool Rim Switching!\n{FF0000}/Boost {FFFF00}For Crazy Server Boost!\n{FF0000}/Radio {FFFF00}For Built In Server Radio!\n Use {FF0000}/AFK {FFFF00}If Your AFK, When Your Back, Use {FF0000}/Back!\n{FF0000}/Neon {FFFF00}& {FF0000}/Tune\n{FF0000}/PM {FFFF00}Private MSG\n{FF0000}/V {FFFF00}Vehicle";
                ShowPlayerDialog(playerid,DIALOG_STYLE_MSGBOX, "Server Commands",str,"OK","");
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)