28.01.2015, 17:39
Was trying to convert Jason's Dynamic Housing System it was in dini but i want it in YSI so i can use it however, am kinda new at converting stuff, so am going to post it here and tell me what i have done wrong because it crashes for some reason.
Here is the code anyways. they was a dini_Create(string); but not sure what to convert it to.
Here is the code anyways. they was a dini_Create(string); but not sure what to convert it to.
Код:
//dini_Create(string); INI_WriteInt(string, "hOwned", 0); INI_WriteBool(string, "hOwner", "Nobody"); INI_WriteInt(string, "hPrice", 0); INI_WriteInt(string, "hLock", 0); INI_WriteFloat(string, "hExteriorX", House[hID][hExteriorX]); INI_WriteFloat(string, "hExteriorY", House[hID][hExteriorY]); INI_WriteFloat(string, "hExteriorZ", House[hID][hExteriorZ]); INI_WriteFloatt(string, "hExteriorA", House[hID][hExteriorA]); INI_WriteInt(string, "hExteriorVW", House[hID][hExteriorVW]); INI_WriteInt(string, "hExteriorInt", House[hID][hExteriorInt]); INI_WriteFloat(string, "hInteriorX", House[hID][hInteriorX]); INI_WriteFloat(string, "hInteriorY", House[hID][hInteriorY]); INI_WriteFloat(string, "hInteriorZ", House[hID][hInteriorZ]); INI_WriteFloat(string, "hInteriorA", House[hID][hInteriorA]); INI_WriteInt(string, "hInteriorVW", House[hID][hInteriorVW]); INI_WriteInt(string, "hInteriorInt", House[hID][hInteriorInt]); stock SaveHouse(houseid) { new File[23]; format(File, sizeof(File), "Houses/%d.ini", houseid); if(fexist(File)) { INI_WriteInt(File, "hOwned", House[houseid][hOwned]); INI_WriteBool(File, "hOwner", House[houseid][hOwner]); INI_WriteInt(File, "hPrice", House[houseid][hPrice]); INI_WriteInt(File, "hLock", House[houseid][hLock]); INI_WriteFloat(File, "hExteriorX", House[houseid][hExteriorX]); INI_WriteFloat(File, "hExteriorY", House[houseid][hExteriorY]); INI_WriteFloat(File, "hExteriorZ", House[houseid][hExteriorZ]); INI_WriteFloat(File, "hExteriorA", House[houseid][hExteriorA]); INI_WriteInt(File, "hExteriorVW", House[houseid][hExteriorVW]); INI_WriteInt(File, "hExteriorInt", House[houseid][hExteriorInt]); INI_WriteFloat(File, "hInteriorX", House[houseid][hInteriorX]); INI_WriteFloat(File, "hInteriorY", House[houseid][hInteriorY]); INI_WriteFloat(File, "hInteriorZ", House[houseid][hInteriorZ]); INI_WriteFloat(File, "hInteriorA", House[houseid][hInteriorA]); INI_WriteInt(File, "hInteriorVW", House[houseid][hInteriorVW]); INI_WriteInt(File, "hInteriorInt", House[houseid][hInteriorInt]); RespawnHousePickup(houseid); } return 1; } stock LoadHouses() { new File[23]; for(new i = 0; i < MAX_HOUSES; i++) { format(File, sizeof(File), "Houses/%d.ini", i); if(fexist(File)) { House[i][hOwned] = INI_Int(File, "hOwned"); House[i][hOwner] = INI_WriteBool(File, "hOwner"); // Not sure about this. House[i][hPrice] = INI_Int(File, "hPrice"); House[i][hLock] = INI_Int(File, "hLock"); House[i][hExteriorX] = INI_Float(File, "hExteriorX"); House[i][hExteriorY] = INI_Float(File, "hExteriorY"); House[i][hExteriorZ] = INI_Float(File, "hExteriorZ"); House[i][hExteriorA] = INI_Float(File, "hExteriorA"); House[i][hExteriorVW] = INI_Float(File, "hExteriorVW"); House[i][hExteriorInt] = INI_Float(File, "hExteriorInt"); House[i][hInteriorX] = INI_Float(File, "hInteriorX"); House[i][hInteriorY] = INI_Float(File, "hInteriorY"); House[i][hInteriorZ] = INI_Float(File, "hInteriorZ"); House[i][hInteriorA] = INI_Float(File, "hInteriorA"); House[i][hInteriorVW] = INI_Int(File, "hInteriorVW"); House[i][hInteriorInt] = INI_Int(File, "hInteriorInt"); ActiveHouses++; RespawnHousePickup(i); } } return 1; }