strange problem - 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: strange problem (
/showthread.php?tid=302616)
strange problem - Unknown123 - 09.12.2011
code
pawn Код:
new strData[8][129];
sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", strData[0], strData[1], strData[2]);
errors
Код:
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23771) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23785) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23828) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23834) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23851) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23857) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23877) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23883) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23900) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
when i comment the code, it compile with no errors, so it have something to do with the code i posted
Re: strange problem - Unknown123 - 09.12.2011
no, 'string' is not a global varible, 'MySQL_Load' is not too, but now i know what cause to the problem, it is this
"new strData[8][129];" if i remove the [129] then it will looks like "new strData[8];" and then it works, but then the info will be stored as integer?
String:
new strData[8][129];
Interger
new strData[8];
correct me if im wrong
Re: strange problem - Unknown123 - 09.12.2011
yes im 100% sure i have no global 'string' and here is my set up
pawn Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
switch(resultid)
{
case 0:
{
new MySQL_Load[140]; //No error
//other
}
case 1:
{
new MySQL_Load[155]; //No error
//other
}
case 2:
{
new MySQL_Load[145]; //No error
//other
}
case 3:
{
new MySQL_Load[561];
new strData[8][129];
sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", StringData[0], StringData[1], StringData[2]);
//other
}
case 5:
{
new string[128]; //Error
//other
}
case 6:
{
new MySQL_Load[150]; //Error
//other
}
case 7:
{
new MySQL_Load[35]; //Error
//other
}
case 8:
{
new string[128]; //Error
//other
}
case 9:
{
new MySQL_Load[128]; //Error
//other
}
case 10:
{
new string[150];
//other
}
case 11:
{
new MySQL_Load[128];
//other
}
case 12:
{
new string[128]; //Error
//other
}
case 13:
{
new MySQL_Load[128]; //Error
//other
}
}
return 1;
}
Re: strange problem - Unknown123 - 09.12.2011
still, same just now i get same error with other name "newString"
Re: strange problem - Unknown123 - 09.12.2011
i did this instead
pawn Код:
new strData1[24], strData2[129], strData3[16];
sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", StringData1, StringData2, StringData3);
and now it works with no errors