SA-MP Forums Archive
Rep[++] - 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: Rep[++] (/showthread.php?tid=555679)



Rep[++] - nezo2001 - 08.01.2015

I want to load all houses so i made this
PHP код:
forward LoadHouses(name[],value[]);
public 
LoadHouses(name[],value[])
{
new 
file[60],houseowner[24];
for(new 
0MAX_HOUSES;i++)
{
format(file,sizeof(file),"FAdmin/houses/%i.ini",i);
INI_Open(file);
INI_Int("Price"),HInfo[i][Price]);
INI_Int("Owned"),HInfo[i][Owned]);
INI_Int("XPos"),HInfo[i][XPos]);
INI_Int("YPos"),HInfo[i][YPos]);
INI_Int("ZPos"),HInfo[i][ZPos]);
INI_Int("VirtualWorld",HInfo[i][VirtualWorld]);
INI_ReadString(houseowner,"Owner");
format(HInfo[i][Owner],24,"%s",houseowner);
HouseEnter[i] = CreatePickup(12831HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],HInfo[i][VirtualWorld]);
HouseExit[i] = CreatePickup(13181443.9237,509.4609,1001.4195,HInfo[i][VirtualWorld]);
new 
labelstring[100];
switch(
HInfo[i][Owned])
{
case 
0:{format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HInfo[i][Price]);}
case 
1:{format(labelstring,sizeof(labelstring),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],HInfo[i][Owner]);}
}
HInfo[i][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],25.0,HInfo[i][VirtualWorld]);
HouseCount++;
INI_Close();
}
return 
1;

But it give me those errores

PHP код:
D:\MyServer\Server\gamemodes\new.pwn(915) : error 029invalid expressionassumed zero
D
:\MyServer\Server\gamemodes\new.pwn(915) : warning 215expression has no effect
D
:\MyServer\Server\gamemodes\new.pwn(915) : error 001expected token";"but found "return"
D:\MyServer\Server\gamemodes\new.pwn(916) : warning 225unreachable code
D
:\MyServer\Server\gamemodes\new.pwn(916) : warning 202number of arguments does not match definition
D
:\MyServer\Server\gamemodes\new.pwn(916) : warning 206redundant testconstant expression is non-zero
D
:\MyServer\Server\gamemodes\new.pwn(916) : error 029invalid expressionassumed zero
D
:\MyServer\Server\gamemodes\new.pwn(916) : warning 215expression has no effect
D
:\MyServer\Server\gamemodes\new.pwn(916) : error 001expected token";"but found "return"
D:\MyServer\Server\gamemodes\new.pwn(917) : warning 225unreachable code
D
:\MyServer\Server\gamemodes\new.pwn(917) : warning 202number of arguments does not match definition
D
:\MyServer\Server\gamemodes\new.pwn(917) : warning 206redundant testconstant expression is non-zero
D
:\MyServer\Server\gamemodes\new.pwn(917) : error 029invalid expressionassumed zero
D
:\MyServer\Server\gamemodes\new.pwn(917) : warning 215expression has no effect
D
:\MyServer\Server\gamemodes\new.pwn(917) : error 001expected token";"but found "return"
D:\MyServer\Server\gamemodes\new.pwn(917) : warning 213tag mismatch
D
:\MyServer\Server\gamemodes\new.pwn(918) : warning 225unreachable code
D
:\MyServer\Server\gamemodes\new.pwn(918) : warning 202number of arguments does not match definition
D
:\MyServer\Server\gamemodes\new.pwn(918) : warning 206redundant testconstant expression is non-zero
D
:\MyServer\Server\gamemodes\new.pwn(918) : error 029invalid expressionassumed zero
D
:\MyServer\Server\gamemodes\new.pwn(918) : warning 215expression has no effect
D
:\MyServer\Server\gamemodes\new.pwn(918) : error 001expected token";"but found "return"
D:\MyServer\Server\gamemodes\new.pwn(918) : warning 213tag mismatch
D
:\MyServer\Server\gamemodes\new.pwn(919) : warning 225unreachable code
D
:\MyServer\Server\gamemodes\new.pwn(919) : warning 202number of arguments does not match definition
D
:\MyServer\Server\gamemodes\new.pwn(919) : warning 206redundant testconstant expression is non-zero
D
:\MyServer\Server\gamemodes\new.pwn(919) : error 029invalid expressionassumed zero
D
:\MyServer\Server\gamemodes\new.pwn(919) : warning 215expression has no effect
D
:\MyServer\Server\gamemodes\new.pwn(919) : error 001expected token";"but found "return"
D:\MyServer\Server\gamemodes\new.pwn(919) : warning 213tag mismatch
D
:\MyServer\Server\gamemodes\new.pwn(920) : warning 225unreachable code
D
:\MyServer\Server\gamemodes\new.pwn(921) : error 017undefined symbol "INI_ReadString" 



Re: Rep[++] - Ciarannn - 08.01.2015

I don't use YINI, but I don't think the include is in included in your script due to:

Quote:

D:\MyServer\Server\gamemodes\new.pwn(921) : error 017: undefined symbol "INI_ReadString"

And it also looks like your indentation is the reason for some of the errors. I used pastebin to upload the code with indentation. If it's neither of them, I'm sorry, but I can't help.

Here is the code with indentation: http://pastebin.com/KadN32xj


Re: Rep[++] - nezo2001 - 08.01.2015

my register system is with Y_Ini and it workes


Re: Rep[++] - Ciarannn - 08.01.2015

Did you try fixing the indentation?


Re: Rep[++] - nezo2001 - 08.01.2015

nothing btw i made this
PHP код:
#parmaga tabsize 0 



Re: Rep[++] - Glossy42O - 08.01.2015

try that
PHP код:
forward LoadHouses(name[],value[]); 
public 
LoadHouses(name[],value[]) 

new 
file[60],houseowner[24]; 
for(new 
0MAX_HOUSES;i++) 

format(file,sizeof(file),"FAdmin/houses/%i.ini",i); 
INI_Open(file); 
INI_Int("Price"),HInfo[i][Price]); 
INI_Int("Owned"),HInfo[i][Owned]); 
INI_Int("XPos"),HInfo[i][XPos]); 
INI_Int("YPos"),HInfo[i][YPos]); 
INI_Int("ZPos"),HInfo[i][ZPos]); 
INI_Int("VirtualWorld",HInfo[i][VirtualWorld]); 
INI_ReadString(houseowner,"Owner"); 
format(HInfo[i][Owner],24,"%s",houseowner); 
HouseEnter[i] = CreatePickup(12831HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],HInfo[i][VirtualWorld]); 
HouseExit[i] = CreatePickup(13181443.9237,509.4609,1001.4195,HInfo[i][VirtualWorld]); 
new 
labelstring[100]; 
switch(
HInfo[i][Owned]) 

case 
0:{format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HInfo[i][Price]);
case 
1:{format(labelstring,sizeof(labelstring),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],HInfo[i][Owner]);} 

HInfo[i][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],25.0,HInfo[i][VirtualWorld]); 
HouseCount++; 
INI_Close(); 

return 
1




Re: Rep[++] - nezo2001 - 08.01.2015

Nothing !