Crazy Errors. How to fix?
#1

If I just compile my gamemode, it compiles without any problem, ok.

but, if I do something like that:

PHP код:
new loja[600]; 
strcat(loja,"1.\tPadaria\n2.\tBinco\n3.\t24/7 Los Santos Loja 1\n4.\t24/7 Los Santos Loja 2\n5.\t24/7 Los Santos Loja 3\n6.\t24/7 Los Santos Loja 4\n7.\t24/7 Los Santos Loja 5\n8.\tCluckin Bell LS\n9.\tCluckin Bell LV 1\n10.\tCluckin Bell LV 2"); 
strcat(loja,"\n11.\tCluckin Bell LV 3\n12.\tBurguer Shot LS Norte\n13.\tBurguer Shot LS Sul\n14.\tBurguer Shot LV 1\n15.\tBurguer Shot LV 2\n16.\tBurguer Shot LV 3\n17.\t1Burguer Shot LV 4\n18.\tPizzaria LS\n19.\tPizzaria LV 1"); 
strcat(loja,"\n20.\tPizzaria LV 2\n21.\tPizzaria LV 3"); 
ShowPlayerDialog(playerid,DIALOG_GPS_LOJASDIALOG_STYLE_LIST,"{00ff00}G.P.S. {ff0000}BSL{00ff00} Lojas:",loja,"Selecionar","Voltar"); 
it gets 26+ errors
crazy things, like:

C:\sampserver\pawno\include\DOF2.inc(460) : warning 219: local variable "i" shadows a variable at a preceding level
C:\sampserver\pawno\include\DOF2.inc(569) : warning 219: local variable "i" shadows a variable at a preceding level
C:\sampserver\pawno\include\DOF2.inc(676) : warning 219: local variable "buf" shadows a variable at a preceding level



of course I've done a lot of tests and I know it is cuz long string on "ShowPlayerDialog"
ok

but, how can I use a long string on "ShowPlayerDialog"?

I've seen 80+ listitens on NG:RP (typing /setstation -> listitem 0)

so, it's not impossible
so, how to do that?
Reply
#2

Change i to j and change buf to bef
Reply
#3

are you kidding, right?
Reply
#4

Err im not... This will fix the I and the buf things
Reply
#5

This error means that a variable has been declared more than one. Make use of the search function to find the variable.
Reply
#6

lol

please, read all the issue guys...

if It would be the problem
the gamemode won't compile before add the "showplayerdialog"...

I told: IT COMPILES GOOD, I mean: without any error.
after add "new loja[600]" and put it on "showplayerdialog", the issue comes.
if there was any "i" or "buf" declared twice, it wouldn't compile before adding that code lol


every amateur scripter knows that it happens on pawn when you try to put a long string on showplayerdialog

I just wanna know the fix for it... =\
Reply
#7

i know your Bumping please stop bumping only bump after 48 hours i know your bumping don't hide it
Reply
#8

Quote:
Originally Posted by dudaefj
Посмотреть сообщение
lol

please, read all the issue guys...

if It would be the problem
the gamemode won't compile before add the "showplayerdialog"...

I told: IT COMPILES GOOD, I mean: without any error.
after add "new loja[600]" and put it on "showplayerdialog", the issue comes.
if there was any "i" or "buf" declared twice, it wouldn't compile before adding that code lol


every amateur scripter knows that it happens on pawn when you try to put a long string on showplayerdialog

I just wanna know the fix for it... =\
Oooh dear. local variable "x" shadows a variable at a preceding level means that a variable has been declared more than once if that was your warning.
Reply
#9

not everything is as it seems.

try to put on "ongamemodeinit()"
playerid = createobject(0,0,0,0,0,0,0);


you will probably get "playerid shadows a variable a precending level" (something like that) in a lot of differents funcionts
even it wasn't declared on a precending level.


or u can try what I've done too, you can see even a right variable will get the same error

probably it is cuz the way the native "showplayerdialog" has been done, when the limit of their string breaks it makes crazy things

I really don't know why, but I would like to know how to fix that.
Reply
#10

Quote:
Originally Posted by dudaefj
Посмотреть сообщение
not everything is as it seems.

try to put on "ongamemodeinit()"
playerid = createobject(0,0,0,0,0,0,0);


you will probably get "playerid shadows a variable a precending level" (something like that) in a lot of differents funcionts
even it wasn't declared on a precending level.


or u can try what I've done too, you can see even a right variable will get the same error

probably it is cuz the way the native "showplayerdialog" has been done, when the limit of their string breaks it makes crazy things

I really don't know why, but I would like to know how to fix that.
It will give
Код:
undefined symbol "playerid"
Not
Код:
local variable "x" shadows a variable at a preceding level
because you are assigning an unassigned integer value to another value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)