Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward SaveAllHouses();
- public SaveAllHouses()
- {
- new i;
- new File;
- while(i < MAX_HOUSES)
- {
- new string[288];
- format(string, sizeof(string), "%d,%f,%f,%f,%f,%f,%f,%d,%d,%d,%s,%s,%d\r\n",
- HouseInfo[i][hID],
- HouseInfo[i][hEntrancePosX],
- HouseInfo[i][hEntrancePosY],
- HouseInfo[i][hEntrancePosZ],
- HouseInfo[i][hExitPosX],
- HouseInfo[i][hExitPosY],
- HouseInfo[i][hExitPosZ],
- HouseInfo[i][hInterior],
- HouseInfo[i][hVirtualWorld],
- HouseInfo[i][hOwned],
- HouseInfo[i][hOwner],
- HouseInfo[i][hDescription],
- HouseInfo[i][hPrice]);
- if(i == 0)
- {
- File = iniOpen("Houses.cfg");
- }
- else
- {
- File = iniOpen("Houses.cfg");
- }
- iniSet(File,"Houses.cfg", string);
- i++;
- iniClose(File);
- }
- i = 0;
- return 1;
- }
- forward ReloadAllHouses();
- public ReloadAllHouses()
- {
- new string[288];
- new arrCoords[13][46];
- new File = iniOpen("Houses.cfg");
- new i;
- if(File)
- {
- while(i < MAX_HOUSES)
- {
- iniOpen("Houses.cfg");
- split(string, arrCoords, ',');
- HouseInfo[i][hID] = strval(arrCoords[0]);
- HouseInfo[i][hEntrancePosX] = floatstr(arrCoords[1]);
- HouseInfo[i][hEntrancePosY] = floatstr(arrCoords[2]);
- HouseInfo[i][hEntrancePosZ] = floatstr(arrCoords[3]);
- HouseInfo[i][hExitPosX] = floatstr(arrCoords[4]);
- HouseInfo[i][hExitPosY] = floatstr(arrCoords[5]);
- HouseInfo[i][hExitPosZ] = floatstr(arrCoords[6]);
- HouseInfo[i][hInterior] = strval(arrCoords[7]);
- HouseInfo[i][hVirtualWorld] = strval(arrCoords[8]);
- HouseInfo[i][hOwned] = strval(arrCoords[9]);
- strmid(HouseInfo[i][hOwner], arrCoords[10], false, strlen(arrCoords[10]), MAX_PLAYER_NAME+1);
- strmid(HouseInfo[i][hDescription], arrCoords[11], false, strlen(arrCoords[1]), 35+1);
- HouseInfo[i][hPrice] = strval(arrCoords[12]);
- i++;
- }
- }
- iniClose(File);
- return 1;
- }
- //sk47 xD
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement