string error? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: string error? (
/showthread.php?tid=388529)
string error? -
0utLaW_ - 29.10.2012
pawn Код:
C:\DOCUME~1\ADMINI~1\Desktop\woodle\GAMEMO~1\ФBА.pwn(1873) : warning 219: local variable "string" shadows a variable at a preceding level
C:\DOCUME~1\ADMINI~1\Desktop\woodle\GAMEMO~1\ФВА.pwn(2056) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
Those are my errrors
pawn Код:
if (strcmp("/help", cmdtext, true) == 0)
{
#define HELP_DIALOG 5
new string[1028];
strcat(string, "{F3FF02}" "dhdfhfdhdfhdfhfd|\n", 1024);
strcat(string, "{F3FF02}" "dhdfhdfhdfhdfhdfhfdhfd |\n", 1024);
strcat(string, "{F3FF02}" "dfhfdhfdhfdhfdhdfhfdhfdhfdhdfhdfhfd |\n", 1024);
strcat(string, "{F3FF02}" "For Rules Type: /rules. For Commands Type: /commands |\n", 1024);
strcat(string, "{F3FF02}" "dhdfhdfhdfdfhfdhdfhdf |\n", 1024);
strcat(string, "{F3FF02}" "gdsgdsgfdghdfhfdhdfhdfhdfh|\n", 1024);
strcat(string, "{F3FF02}" "sfafsafsafsafsafsa, ||", 1024);
strcat(string, "{F3FF02}" "asfsafasfasfasfasfsafsafasfas ||", 1024);
strcat(string, "{F3FF02}" "sfsafsafsafsafsaf ||", 1024);
strcat(string, "{F3FF02}" "sdfghjkl;, ||", 1024);
strcat(string, "{F3FF02}" "adhgjgfgfgfg", 1024);
ShowPlayerDialog(playerid,DIALOG_ANIMS,DIALOG_STYLE_MSGBOX,"{FFAF00}" "Menu" "{FFAF00}" "Help", string, "Ok", "Cancel");
return 1;
}
thats my command
and when the dialog pops its looks something likes this
How do i fix this?
Re: string error? -
JhnzRep - 29.10.2012
Simplest way to fix it would be to rename string to str.
Re: string error? -
0utLaW_ - 29.10.2012
pawn Код:
C:\DOCUME~1\ADMINI~1\Desktop(2056) : warning 204: symbol is assigned a value that is never used: "string1"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
when i rename all of them the command doesnt works.
Re: string error? -
JhnzRep - 29.10.2012
Did you rename it in "ShowPlayerDialog" too?
Re: string error? -
0utLaW_ - 29.10.2012
Now the command works but it looks like
http://imgur.com/g4kwz
D:
Re: string error? -
JhnzRep - 29.10.2012
What? You mean that it cuts off?
Re: string error? -
0utLaW_ - 29.10.2012
yes when i add more lines it just goes out of the screen and looks ugly
Re: string error? -
JhnzRep - 29.10.2012
Sorry, I don't really know how to help you with that much, maybe create a new line instead of making one so long?
Re: string error? -
0utLaW_ - 29.10.2012
there is a new line in script for it
but inside the gamemode it all just shows in 1 line
Re: string error? -
jessejanssen - 29.10.2012
You should put "\n" when you want an enter in the sentence shown in game. \n simply stands for an enter.
Jesse