SA-MP Forums Archive
[SOLVED] dini_get - variable - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] dini_get - variable (/showthread.php?tid=93655)



[SOLVED] dini_get - variable - kevin974 - 26.08.2009

Код:
public LoadPlayerHouses(houseid)
{
  new house[64];
  format(house, sizeof(house), "/Houses/%d.dini.save", houseid);
  if(dini_Exists(house))
  {
    format(HouseInfo[houseid][hName], 24, "%s", dini_Get(house, "Name"));
    HouseInfo[houseid][hSellable] 	 = dini_Int(house, "For_Sell");
		HouseInfo[houseid][hSell] 	 	 = dini_Int(house, "Sell_Price");
    	HouseInfo[houseid][hRent] 	 	 = dini_Int(house, "Rent_Price");
    	HouseInfo[houseid][hLevel] 		 = dini_Int(house, "House_Level");
    	HouseInfo[houseid][hEnterX] 	 = dini_Float(house, "Enter_Coord:X");
    	HouseInfo[houseid][hEnterY] 	 = dini_Float(house, "Enter_Coord:Y");
    	HouseInfo[houseid][hEnterZ] 	 = dini_Float(house, "Enter_Coord:Z");
    	HouseInfo[houseid][hExitX] 	 = dini_Float(house, "Exit_Coord:X");
    	HouseInfo[houseid][hExitY] 	 = dini_Float(house, "Exit_Coord:Y");
    HouseInfo[houseid][hExitZ] 	 = dini_Float(house, "Exit_Coord:Z");
    	HouseInfo[houseid][hInterior] 	 = dini_Int(house, "Interior");
    	HouseInfo[houseid][hVirtualWorld] = dini_Int(house, "VirtualWorld");
    	HouseInfo[houseid][hLocked] 	 = dini_Int(house, "Status");
	}
}
When i try and retrieve the information from HouseInfo[houseid][hName] i get a scrambled message. How do i fix this?


Re: [HELP] dini_get - variable - dice7 - 26.08.2009

Do you have
pawn Код:
enum
{
Float:hEnterX,
Float:hEnterY,
Float:hEnterZ
};
?


Re: [HELP] dini_get - variable - kevin974 - 26.08.2009

Yes
Код:
enum hInfo
{
	hName,
	hSellable,
	hSell,
	hRent,
	hLevel,
	hPickup,
	Float:hEnterX,
	Float:hEnterY,
	Float:hEnterZ,
	Float:hExitX,
	Float:hExitY,
	Float:hExitZ,
	hInterior,
	hVirtualWorld,
	hLocked
};
new HouseInfo[MAX_HOUSES][hInfo];
But the problem is when i try and retreave the information from HouseInfo[houseid][hName]


Re: [HELP] dini_get - variable - Zeex - 26.08.2009

pawn Код:
enum hInfo
{
    hName[24],
    .....
};



Re: [HELP] dini_get - variable - dice7 - 26.08.2009

If that won't work, use hName[256], since dini returns MAX_STRING afaik


Re: [HELP] dini_get - variable - kevin974 - 26.08.2009

Thank you zeek, it works great.