1 Warning, plz help!
#1

i have this error:
(308line): warning 219: local variable "File" shadows a variable at a preceding level

in 308line:
stock UF(playerid)
{
new Name[MAX_PLAYER_NAME],File[40];
GetPlayerName(playerid,Name,sizeof(Name));
format(File,sizeof(File),"Users/%s.ShahaR",Name);
if(!dini_Exists(File)){ dini_Create(File); }
return File;
}


someone know what the problem?
Reply
#2

Warnings are not imporant, you can compile it, It gives you the .amx.
Reply
#3

Quote:
Originally Posted by Mr.1337
Посмотреть сообщение
Warnings are not imporant, you can compile it, It gives you the .amx.
They are important. And try renaming File to something like: File2, Or just remove the file variable.
Reply
#4

Quote:
Originally Posted by Mr.1337
Посмотреть сообщение
Warnings are not imporant, you can compile it, It gives you the .amx.
Loose Indentation warning might not affect the script, but it's strongly recommended to indent your code, most of the other warnings cause non-working script.
Reply
#5

so what to do?
Reply
#6

pawn Код:
stock UF(playerid)
{
    new Name[MAX_PLAYER_NAME],i_File[40];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(i_File,sizeof(i_File),"Users/%s.ShahaR",Name);
    if(!dini_Exists(i_File)) { dini_Create(i_File); }
    return 1;
}
Reply
#7

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
stock UF(playerid)
{
    new Name[MAX_PLAYER_NAME],i_File[40];
    GetPlayerName(playerid,Name,sizeof(Name));
    format(i_File,sizeof(i_File),"Users/%s.ShahaR",Name);
    if(!dini_Exists(i_File)) { dini_Create(i_File); }
    return 1;
}
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(362) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(363) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(364) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(365) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(366) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(367) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(36 : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(369) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(370) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(374) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(375) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(376) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(377) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(37 : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(379) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(380) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(381) : error 035: argument type mismatch (argument 1)
C:\Users\user\Documents\GTA San Andreas User Files\Server\filterscripts\FcCwSsSpN.pwn(382) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


18 Errors.
Reply
#8

You have multiple new file[128] (or whatever your string size is) in your gamemode. This also gave me the same when I was learning coord's

BTW, tip: any loose indentitation warnings can be supressed by doing
pawn Код:
#pragma tabsize 0
under your includes.
Reply
#9

Quote:
Originally Posted by robintjeh
Посмотреть сообщение
You have multiple new file[128] (or whatever your string size is) in your gamemode. This also gave me the same when I was learning coord's

BTW, tip: any loose indentitation warnings can be supressed by doing
pawn Код:
#pragma tabsize 0
under your includes.
Can ALL OF YOU not talk about it, it's not recommended to use that pragma, and it hides obvious errors. Don't be a lazy dog and indent your mess!
Reply
#10

so what to do?
Reply
#11

Maybe showing us which are the error lines? The code provided looks good.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)