Guest User

BUG CASAS

a guest
Oct 2nd, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.56 KB | None | 0 0
  1. // CREIO QUE SEJA ISSO QUE QUEIRA ....
  2.  
  3.  
  4.  
  5. new HouseInfo[309][hInfo];
  6. // ============================================================================================================ //
  7. public LoadProperty()
  8. {
  9.     new arrCoords[30][64];
  10.     new strFromFile2[256];
  11.     new File: file = fopen("PlayFaster/Casas.cfg", io_read);
  12.     if (file)
  13.     {
  14.         new idx;
  15.         while (idx < sizeof(HouseInfo))
  16.         {
  17.             fread(file, strFromFile2);
  18.             split(strFromFile2, arrCoords, ',');
  19.             HouseInfo[idx][hEntrancex] = floatstr(arrCoords[0]);
  20.             HouseInfo[idx][hEntrancey] = floatstr(arrCoords[1]);
  21.             HouseInfo[idx][hEntrancez] = floatstr(arrCoords[2]);
  22.             HouseInfo[idx][hExitx] = floatstr(arrCoords[3]);
  23.             HouseInfo[idx][hExity] = floatstr(arrCoords[4]);
  24.             HouseInfo[idx][hExitz] = floatstr(arrCoords[5]);
  25.             HouseInfo[idx][hHealthx] = strval(arrCoords[6]);
  26.             HouseInfo[idx][hHealthy] = strval(arrCoords[7]);
  27.             HouseInfo[idx][hHealthz] = strval(arrCoords[8]);
  28.             HouseInfo[idx][hArmorrx] = strval(arrCoords[9]);
  29.             HouseInfo[idx][hArmorry] = strval(arrCoords[10]);
  30.             HouseInfo[idx][hArmorrz] = strval(arrCoords[11]);
  31.             //printf("HouseInfo hEntrancez %f",HouseInfo[idx][hEntrancez]);
  32.             strmid(HouseInfo[idx][hOwner], arrCoords[12], 0, strlen(arrCoords[12]), 255);
  33.             strmid(HouseInfo[idx][hDiscription], arrCoords[13], 0, strlen(arrCoords[13]), 255);
  34.             HouseInfo[idx][hValue] = strval(arrCoords[14]);
  35.             HouseInfo[idx][hHel] = strval(arrCoords[15]);
  36.             HouseInfo[idx][hArm] = strval(arrCoords[16]);
  37.             HouseInfo[idx][hInt] = strval(arrCoords[17]);
  38.             HouseInfo[idx][hLock] = strval(arrCoords[18]);
  39.             HouseInfo[idx][hOwned] = strval(arrCoords[19]);
  40.             HouseInfo[idx][hRooms] = strval(arrCoords[20]);
  41.             HouseInfo[idx][hRent] = strval(arrCoords[21]);
  42.             HouseInfo[idx][hRentabil] = strval(arrCoords[22]);
  43.             HouseInfo[idx][hTakings] = strval(arrCoords[23]);
  44.             HouseInfo[idx][hVec] = strval(arrCoords[24]);
  45.             if(HouseInfo[idx][hVec] == 587)
  46.             {
  47.                 HouseInfo[idx][hVec] = 587;
  48.             }
  49.             HouseInfo[idx][hVcol1] = strval(arrCoords[25]);
  50.             HouseInfo[idx][hVcol2] = strval(arrCoords[26]);
  51.             HouseInfo[idx][hDate] = strval(arrCoords[27]);
  52.             HouseInfo[idx][hLevel] = strval(arrCoords[28]);
  53.             HouseInfo[idx][hWorld] = strval(arrCoords[29]);
  54.             idx++;
  55.         }
  56.         printf("casas carregadas", idx);
  57.         printf("Anti-xiters carregados ", idx);
  58.         fclose(file);
  59.     }
  60.     return true;
  61. }
  62.  
  63. // ============================================================================================================================ //
  64.  
  65. public OnPropUpdate()
  66. {
  67.     new idx;
  68.     new File: file2;
  69.     while (idx < sizeof(HouseInfo))
  70.     {
  71.         new coordsstring[256];
  72.         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",
  73.         HouseInfo[idx][hEntrancex],
  74.         HouseInfo[idx][hEntrancey],
  75.         HouseInfo[idx][hEntrancez],
  76.         HouseInfo[idx][hExitx],
  77.         HouseInfo[idx][hExity],
  78.         HouseInfo[idx][hExitz],
  79.         HouseInfo[idx][hHealthx],
  80.         HouseInfo[idx][hHealthy],
  81.         HouseInfo[idx][hHealthz],
  82.         HouseInfo[idx][hArmorrx],
  83.         HouseInfo[idx][hArmorry],
  84.         HouseInfo[idx][hArmorrz],
  85.         HouseInfo[idx][hOwner],
  86.         HouseInfo[idx][hDiscription],
  87.         HouseInfo[idx][hValue],
  88.         HouseInfo[idx][hHel],
  89.         HouseInfo[idx][hArm],
  90.         HouseInfo[idx][hInt],
  91.         HouseInfo[idx][hLock],
  92.         HouseInfo[idx][hOwned],
  93.         HouseInfo[idx][hRooms],
  94.         HouseInfo[idx][hRent],
  95.         HouseInfo[idx][hRentabil],
  96.         HouseInfo[idx][hTakings],
  97.         HouseInfo[idx][hVec],
  98.         HouseInfo[idx][hVcol1],
  99.         HouseInfo[idx][hVcol2],
  100.         HouseInfo[idx][hDate],
  101.         HouseInfo[idx][hLevel],
  102.         HouseInfo[idx][hWorld]);
  103.         HouseInfo[idx][hWorld] = idx;
  104.         if(idx == 0)
  105.         {
  106.             file2 = fopen("PlayFaster/Casas.cfg", io_write);
  107.         }
  108.         else
  109.         {
  110.             file2 = fopen("PlayFaster/Casas.cfg", io_append);
  111.         }
  112.         fwrite(file2, coordsstring);
  113.         idx++;
  114.         fclose(file2);
  115.     }
  116.  
  117.  
  118. // ========================================================================================================================= //
  119.  
  120.  
  121.         }
  122.  
  123.         if(House !=500 && PlayerInfo[playerid][pSpawn] == 1)
  124.         {
  125.             XXAirBreak[playerid] += 3;
  126.             SetPlayerToTeamColor(playerid);
  127.             SetPlayerInterior(playerid,HouseInfo[House][hInt]);
  128.             SetPlayerVirtualWorld(playerid,HouseInfo[House][hWorld]);
  129.             XXAirBreak[playerid] += 3;SetPlayerPos(playerid, HouseInfo[House][hExitx], HouseInfo[House][hExity],HouseInfo[House][hExitz]); // Warp the player
  130.             PlayerInfo[playerid][pLocal] = House;
  131.             PlayerInfo[playerid][pInt] = HouseInfo[House][hInt];
  132.             HouseEntered[playerid] = House;
  133.             return true;
  134.         }
  135.        
  136.  
  137. // ====================================================================================================================== //
  138.  
  139.  
  140. }
  141.                         if(House == 241)//City Hall
  142.                         {
  143.                             SetPlayerInterior(i,0);
  144.                             XXAirBreak[i] += 3;SetPlayerPos(i,1480.9403,-1770.8481,18.7958);
  145.                             PlayerInfo[i][pInt] = 0;
  146.                             PlayerInfo[i][pLocal] = 255;
  147.                         }
  148.                         if(House >= 99 && House != 10000)
  149.                         {
  150.                             XXAirBreak[i] += 3;SetPlayerPos(i, BizzInfo[House-99][bEntranceX], BizzInfo[House-99][bEntranceY],BizzInfo[House-99][bEntranceZ]); // Warp the player
  151.                             PlayerInfo[i][pLocal] = 255;
  152.                             SetPlayerInterior(i,0);
  153.                             PlayerInfo[i][pInt] = 0;
  154.                         }
  155.                         else if(House < 99 && House != 10000)
  156.                         {
  157.                             XXAirBreak[i] += 3;SetPlayerPos(i, HouseInfo[House][hEntrancex], HouseInfo[House][hEntrancey],HouseInfo[House][hEntrancez]); // Warp the player
  158.                             PlayerInfo[i][pLocal] = 255;
  159.                             SetPlayerInterior(i,0);
  160.                             PlayerInfo[i][pInt] = 0;
  161.                         }
  162.  
  163.  
  164. // =================================================================================================================== //
  165.  
  166.  
  167.     for(new i = 0; i < sizeof(CreatedCars);i++)
  168.     {
  169.         CreatedCars[i] = 0;
  170.     }
  171.     for(new i = 0; i <= sizeof(Peds)-1; i++)
  172.     {
  173.         AddPlayerClass(Peds[i][0],1958.3783,1343.1572,1100.3746,269.1425,-1,-1,-1,-1,-1,-1);
  174.     }
  175.     for(new h = 0; h < sizeof(HouseInfo); h++)
  176.     {
  177.         if(HouseInfo[0][hOwned] == 0)
  178.         {
  179.             AddStaticPickup(1273, 23, HouseInfo[0][hEntrancex], HouseInfo[0][hEntrancey], HouseInfo[0][hEntrancez]);
  180.         }
  181.         if(HouseInfo[0][hOwned] == 1)
  182.         {
  183.            AddStaticPickup(1239, 23, HouseInfo[0][hEntrancex], HouseInfo[0][hEntrancey], HouseInfo[0][hEntrancez]);
  184.         }
  185.         if(HouseInfo[h][hOwned] == 0)
  186.         {
  187.             AddStaticPickup(1273, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  188.             pickups++;
  189.             format(gGstring, sizeof(gGstring), TextCasaVenda,HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
  190.             HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
  191.         }
  192.         if(HouseInfo[h][hOwned] == 1)
  193.         {
  194.             AddStaticPickup(1239, 23, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
  195.             pickups++;
  196.             if(HouseInfo[h][hRentabil] == 0)
  197.             {
  198.                 format(gGstring, sizeof(gGstring), TextCasa,HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
  199.                 HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
  200.             }
  201.             else
  202.             {
  203.                 format(gGstring, sizeof(gGstring), TextCasaAl,HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
  204.                 HouseLabel[h] = Create3DTextLabel(gGstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,13.0,0);
  205.             }
  206.         }
  207.     }
  208.  
  209. // ===================================================================================================================== //
Advertisement
Add Comment
Please, Sign In to add comment