Pomoc oko vozila

Započeo Anaconda, April 08, 2020, 19:27:43 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Objasnjene:Kada se auto kupi i tinuri kada se parkira tjun nestane.Kada izadjem i udjem u server auto nije u mome vlasnistvu:

YCMD:kupiauto(playerid, params[], help)
{
   #pragma unused help
   #pragma unused params
   if(UlogovanProvera[playerid] == 0) return nisiulogovan(playerid);
   if(PlayerInfo[playerid][pDvaV] == 1)
   {
      if(PlayerInfo[playerid][pPosedovanjeAuta] != -1 && PlayerInfo[playerid][pPosedovanjeAuta2] != -1) return SCM(playerid,-1,""SIVA"Vec posedujes 2 auta!");
   }
   else
   {
      if(PlayerInfo[playerid][pPosedovanjeAuta] != -1) return SCM(playerid,-1,""SIVA"Vec posedujes auto!");
   }
   if(PlayerInfo[playerid][pLevel] < 4) return SCM(playerid,-1,""SIVA"Morate biti level 4+ za kupovinu auta!");
   if(IsPlayerInRangeOfPoint(playerid, 5.0, 565.0984, -1285.4423, 17.2482) || IsPlayerInRangeOfPoint(playerid, 5.0, 1713.8436,-1124.1605,24.3413))
   {
      new string [128];
      if(KupovinaAuta[playerid] == true) return SCM(playerid,-1,""SIVA"Vec gledate katalog vozila!");
      if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid,-1,""SIVA"Ne mozete gledati katalog iz vozila!");
      if(ServerInfo[isdozvolakupovine] == 0) return SCM(playerid,-1,"BS:RP | "CRVENA"Vlasnik je iskljucio salone!");
      if(autokatalog != 0) return SCM(playerid,-1,""SIVA"Neko vec pregleda katalog!");
      TogglePlayerControllable(playerid, 0); KupovinaAuta[playerid] = true; PrikaziVozilaTD(playerid); autokatalog = 1;
      format(string,sizeof(string),"%s",ImenaVozila[GetVehicleModel(IzlozbenoAuto) - 400]);
      PlayerTextDrawSetString(playerid,TDProdajaVozila[2][playerid],string);
      format(string,sizeof(string),"Cena: ~g~%d$",AutoSalon[AutoModel][1]);
      PlayerTextDrawSetString(playerid,TDProdajaVozila[3][playerid],string);
      SCM(playerid, -1, "[BS:RP] "ZELENA"VAZNO!!! SISTEM KORISTI VASE TRENUTNE TIPKE, DAKLE AKO STE MENJALI PROCITAJTE!!!");
       SCM(playerid, -1, "[BS:RP] "ZELENA"Koristite tipke NUMPAD 1-6 ili LEVO/DESNO za listanje vozila!");
      SCM(playerid, -1, "[BS:RP] "ZELENA"Za kupovinu stisnite ENTER ili F! ");
      SCM(playerid, -1, "[BS:RP] "ZELENA"Za izlaz stisnite tipku za skakanje!(SHIFT/SPACE)");
      SetPlayerCameraPos(playerid, 550.461853, -1278.702392, 21.356954);
       SetPlayerCameraLookAt(playerid, 547.587158, -1274.942382, 19.745004);
    }
    else if(UsaoAutoProdaja[playerid] != -1)
    {
        new i = UsaoAutoProdaja[playerid];
        if(VoziloInfo[vImaVlasnika] == 0)
      {
          new vid = CijeneAuta(GetVehicleModel(GetPlayerVehicleID(playerid)));
          if(PlayerInfo[playerid][pNovacDzep] < AutoSalon[vid][1]/2) return SCM(playerid,-1,""SIVA"Nemate dovoljno novca!");
          g_NovacMinus(playerid, AutoSalon[vid][1]/2);
            if(PlayerInfo[playerid][pPosedovanjeAuta] != -1)
         {
            PlayerInfo[playerid][pPosedovanjeAuta2] = i;
         }
         else
         {
            PlayerInfo[playerid][pPosedovanjeAuta] = i;
         }
         VoziloInfo[vRadio] = 0;
         VoziloInfo[vImaVlasnika] = 1; VoziloInfo[vZakljucan] = 1;
         VoziloInfo[vDroga] = 0; VoziloInfo[vMats] = 0;
         VoziloInfo[vOruzije] = -1; VoziloInfo[vMunicija] = 0;
         strmid(VoziloInfo[vVlasnik], GetName(playerid), 0, strlen(GetName(playerid)), 999);
           SacuvajVozilo(i); SavePlayer(playerid); TogglePlayerControllable(playerid, 1);
           SCMF(playerid,-1,""CRVENA"BS:RP | "BELA"Uspesno ste kupili polovan auto za %d$ novca!",AutoSalon[vid][1]/2);
           UsaoAutoProdaja[playerid] = -1;
      }
      else return SCM(playerid,-1,""CRVENA"BS:RP | "SIVA"To vozilo nije na prodaju!");
    }
   return 1;
}
////////////////////////////////EVO ZA TUNE
YCMD:tunecar(playerid, params[], help)
{
   #pragma unused params
   #pragma unused help
   //if(PlayerInfo[playerid][pVip] < 1 && PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pGM] < 1) return SCM(playerid, 1, "Niste ovlasceni da koristite ovu komandu (V.I.P/Staff)");
   new playerstate = GetPlayerState(playerid);
   if(playerstate == PLAYER_STATE_DRIVER)
   {
        if(!PlayerToPoint(5.0,playerid,2455.2229,-1460.9663,24.0000)){ SendClientMessage(playerid, -1, "{FF0000}[GRESKA]{FFFFFF}Niste na mestu za tuniranje vozila !");return 1;}
      if(GetPlayerVehicleID(playerid) != VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta
      ]][vID] && GetPlayerVehicleID(playerid) != VoziloInfo[PlayerInfo[playerid][pPosedovanjeAuta2
      ]][vID]) return SCM(playerid, -1, ""CRVENA"(GRESKA)"SIVA"Mozete tunirate svamo privatno vozilo");
      switch(pmodelid[playerid])
      {
         case 562,565,559,561,560,575,534,567,536,535,576,411,579,602,496,518,527,589,597,419,
         533,526,474,545,517,410,600,436,580,439,549,491,445,604,507,585,587,466,492,546,551,516,
         426,547,405, 409,550,566,406,540,421,529,431,438,437,420,525,552,416,433,427,490,528,
         407,544,598,470,503,502,531,596,599,601,428,499,609,524,578,486,573,455,588,403,
         414,443,515,456,422,482,530,418,572,413,440,543,583,478,554,402,542,603,475,568,504,457,
         483,508,429,541,415,480,434,506,451,555,477,400,404,489,479,442,458,467,558,514,423:
         {
            ShowPlayerDialog(playerid, 1338, DIALOG_STYLE_LIST, "Tune car menu","Paint Jobs\nColors\nExhausts\nFront Bumper\nRear Bumper\nRoof\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nNext page", "Select", "Exit");
            return SendClientMessage(playerid, 0xFFFF00AA, "[INFO] Select an item.");
         }
         default: return SendClientMessage(playerid,126267562,"[ERROR] Ne mozes tunirati ovo vozilo!");
      }
   }
   else SendClientMessage(playerid, 126267562, "[ERROR] Moras biti vozac!");
   return 1;
}

Moras proveriti ocitavanje i save vozila, po definiciji. Nisi nesto dobro uradio oko Ocitavanja Vozila takodje i Cuvanja. Javi se u pp da resimo taj problem.   8)

Citat: Natz poslato April 08, 2020, 20:27:14 POSLE PODNE
Moras proveriti ocitavanje i save vozila, po definiciji. Nisi nesto dobro uradio oko Ocitavanja Vozila takodje i Cuvanja. Javi se u pp da resimo taj problem.   8)
EE kako to da provjerim

Pročitaj pravila pdfa
»Sve što je na Zemlji, prolazno je...«