Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CREIO QUE SEJA ISSO QUE QUEIRA ....
- new HouseInfo[309][hInfo];
- // ============================================================================================================ //
- public LoadProperty()
- {
- new arrCoords[30][64];
- new strFromFile2[256];
- new File: file = fopen("PlayFaster/Casas.cfg", io_read);
- if (file)
- {
- new idx;
- while (idx < sizeof(HouseInfo))
- {
- fread(file, strFromFile2);
- split(strFromFile2, arrCoords, ',');
- HouseInfo[idx][hEntrancex] = floatstr(arrCoords[0]);
- HouseInfo[idx][hEntrancey] = floatstr(arrCoords[1]);
- HouseInfo[idx][hEntrancez] = floatstr(arrCoords[2]);
- HouseInfo[idx][hExitx] = floatstr(arrCoords[3]);
- HouseInfo[idx][hExity] = floatstr(arrCoords[4]);
- HouseInfo[idx][hExitz] = floatstr(arrCoords[5]);
- HouseInfo[idx][hHealthx] = strval(arrCoords[6]);
- HouseInfo[idx][hHealthy] = strval(arrCoords[7]);
- HouseInfo[idx][hHealthz] = strval(arrCoords[8]);
- HouseInfo[idx][hArmorrx] = strval(arrCoords[9]);
- HouseInfo[idx][hArmorry] = strval(arrCoords[10]);
- HouseInfo[idx][hArmorrz] = strval(arrCoords[11]);
- //printf("HouseInfo hEntrancez %f",HouseInfo[idx][hEntrancez]);
- strmid(HouseInfo[idx][hOwner], arrCoords[12], 0, strlen(arrCoords[12]), 255);
- strmid(HouseInfo[idx][hDiscription], arrCoords[13], 0, strlen(arrCoords[13]), 255);
- HouseInfo[idx][hValue] = strval(arrCoords[14]);
- HouseInfo[idx][hHel] = strval(arrCoords[15]);
- HouseInfo[idx][hArm] = strval(arrCoords[16]);
- HouseInfo[idx][hInt] = strval(arrCoords[17]);
- HouseInfo[idx][hLock] = strval(arrCoords[18]);
- HouseInfo[idx][hOwned] = strval(arrCoords[19]);
- HouseInfo[idx][hRooms] = strval(arrCoords[20]);
- HouseInfo[idx][hRent] = strval(arrCoords[21]);
- HouseInfo[idx][hRentabil] = strval(arrCoords[22]);
- HouseInfo[idx][hTakings] = strval(arrCoords[23]);
- HouseInfo[idx][hVec] = strval(arrCoords[24]);
- if(HouseInfo[idx][hVec] == 587)
- {
- HouseInfo[idx][hVec] = 587;
- }
- HouseInfo[idx][hVcol1] = strval(arrCoords[25]);
- HouseInfo[idx][hVcol2] = strval(arrCoords[26]);
- HouseInfo[idx][hDate] = strval(arrCoords[27]);
- HouseInfo[idx][hLevel] = strval(arrCoords[28]);
- HouseInfo[idx][hWorld] = strval(arrCoords[29]);
- idx++;
- }
- printf("casas carregadas", idx);
- printf("Anti-xiters carregados ", idx);
- fclose(file);
- }
- return true;
- }
- // ============================================================================================================================ //
- public OnPropUpdate()
- {
- new idx;
- new File: file2;
- while (idx < sizeof(HouseInfo))
- {
- new coordsstring[256];
- format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
- HouseInfo[idx][hEntrancex],
- HouseInfo[idx][hEntrancey],
- HouseInfo[idx][hEntrancez],
- HouseInfo[idx][hExitx],
- HouseInfo[idx][hExity],
- HouseInfo[idx][hExitz],
- HouseInfo[idx][hHealthx],
- HouseInfo[idx][hHealthy],
- HouseInfo[idx][hHealthz],
- HouseInfo[idx][hArmorrx],
- HouseInfo[idx][hArmorry],
- HouseInfo[idx][hArmorrz],
- HouseInfo[idx][hOwner],
- HouseInfo[idx][hDiscription],
- HouseInfo[idx][hValue],
- HouseInfo[idx][hHel],
- HouseInfo[idx][hArm],
- HouseInfo[idx][hInt],
- HouseInfo[idx][hLock],
- HouseInfo[idx][hOwned],
- HouseInfo[idx][hRooms],
- HouseInfo[idx][hRent],
- HouseInfo[idx][hRentabil],
- HouseInfo[idx][hTakings],
- HouseInfo[idx][hVec],
- HouseInfo[idx][hVcol1],
- HouseInfo[idx][hVcol2],
- HouseInfo[idx][hDate],
- HouseInfo[idx][hLevel],
- HouseInfo[idx][hWorld]);
- HouseInfo[idx][hWorld] = idx;
- if(idx == 0)
- {
- file2 = fopen("PlayFaster/Casas.cfg", io_write);
- }
- else
- {
- file2 = fopen("PlayFaster/Casas.cfg", io_append);
- }
- fwrite(file2, coordsstring);
- idx++;
- fclose(file2);
- }
- // ========================================================================================================================= //
- }
- if(House !=500 && PlayerInfo[playerid][pSpawn] == 1)
- {
- XXAirBreak[playerid] += 3;
- SetPlayerToTeamColor(playerid);
- SetPlayerInterior(playerid,HouseInfo[House][hInt]);
- SetPlayerVirtualWorld(playerid,HouseInfo[House][hWorld]);
- XXAirBreak[playerid] += 3;SetPlayerPos(playerid, HouseInfo[House][hExitx], HouseInfo[House][hExity],HouseInfo[House][hExitz]); // Warp the player
- PlayerInfo[playerid][pLocal] = House;
- PlayerInfo[playerid][pInt] = HouseInfo[House][hInt];
- HouseEntered[playerid] = House;
- return true;
- }
- // ====================================================================================================================== //
- }
- if(House == 241)//City Hall
- {
- SetPlayerInterior(i,0);
- XXAirBreak[i] += 3;SetPlayerPos(i,1480.9403,-1770.8481,18.7958);
- PlayerInfo[i][pInt] = 0;
- PlayerInfo[i][pLocal] = 255;
- }
- if(House >= 99 && House != 10000)
- {
- XXAirBreak[i] += 3;SetPlayerPos(i, BizzInfo[House-99][bEntranceX], BizzInfo[House-99][bEntranceY],BizzInfo[House-99][bEntranceZ]); // Warp the player
- PlayerInfo[i][pLocal] = 255;
- SetPlayerInterior(i,0);
- PlayerInfo[i][pInt] = 0;
- }
- else if(House < 99 && House != 10000)
- {
- XXAirBreak[i] += 3;SetPlayerPos(i, HouseInfo[House][hEntrancex], HouseInfo[House][hEntrancey],HouseInfo[House][hEntrancez]); // Warp the player
- PlayerInfo[i][pLocal] = 255;
- SetPlayerInterior(i,0);
- PlayerInfo[i][pInt] = 0;
- }
- // =================================================================================================================== //
- for(new i = 0; i < sizeof(CreatedCars);i++)
- {
- CreatedCars[i] = 0;
- }
- for(new i = 0; i <= sizeof(Peds)-1; i++)
- {
- AddPlayerClass(Peds[i][0],1958.3783,1343.1572,1100.3746,269.1425,-1,-1,-1,-1,-1,-1);
- }
- for(new h = 0; h < sizeof(HouseInfo); h++)
- {
- if(HouseInfo[0][hOwned] == 0)
- {
- AddStaticPickup(1273, 23, HouseInfo[0][hEntrancex], HouseInfo[0][hEntrancey], HouseInfo[0][hEntrancez]);
- }
- if(HouseInfo[0][hOwned] == 1)
- {
- AddStaticPickup(1239, 23, HouseInfo[0][hEntrancex], HouseInfo[0][hEntrancey], HouseInfo[0][hEntrancez]);
- }
- if(HouseInfo[h][hOwned] == 0)
- {
- AddStaticPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
- pickups++;
- format(gGstring, sizeof(gGstring), TextCasaVenda,HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
- HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
- }
- if(HouseInfo[h][hOwned] == 1)
- {
- AddStaticPickup(1239, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
- pickups++;
- if(HouseInfo[h][hRentabil] == 0)
- {
- format(gGstring, sizeof(gGstring), TextCasa,HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
- HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
- }
- else
- {
- format(gGstring, sizeof(gGstring), TextCasaAl,HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
- HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
- }
- }
- }
- // ===================================================================================================================== //
Advertisement
Add Comment
Please, Sign In to add comment