Kako mogu rijesit da nestane /kupiauto cim se kupi auto

Započeo Markoo00, Novembar 13, 2022, 17:57:26 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Pitanje/savjet:Kad ucem u auto i upisem /kupiauto kupim auto ali mi ne nestane ono sto pise na autu /kupiauo kako bi to mogao smaket
Opširnije: https://ibb.co/KLVzKj8 slika
Dodatno: [pawn]   IzlozbenoAuto = CreateVehicle(AutoSalon[AutoModel][0], AIZLOZBENO_X,AIZLOZBENO_Y,AIZLOZBENO_Z,AIZLOZBENO_A, 2, 2, 30000);
   for(new i = 0; i < sizeof(VoziloInfo); i++)
   {
      new vFile[50];
        format(vFile, sizeof(vFile), AUTO_FILE, i);
        if(fexist(vFile))
        {
            INI_ParseFile(vFile, "UcitajVozila", .bExtra = true, .extra = i);
            VoziloInfo[vID] = CreateVehicle(VoziloInfo[vModel],VoziloInfo[vPozX],VoziloInfo[vPozY],VoziloInfo[vPozZ],VoziloInfo[vPozA],VoziloInfo[vBoja1],VoziloInfo[vBoja2],30000);
           SetVehicleModifications(i, VoziloInfo[vID]);

            if(VoziloInfo[vImaVlasnika] == 0)
            {
            new string[300];
            new vid = ceneAuta(VoziloInfo[vModel]); //AutoSalon[vid][1]
            format(string,sizeof(string),""PLAVA"[Auto na prodaju]\nModel: "BELA"%s\n"PLAVA"Cena: "BELA"%d$\n"PLAVA"Da kupite auto "BELA"/kupiauto",VoziloInfo[vModelV],AutoSalon[vid][1]);
            VehicleLabel = CreateDynamic3DTextLabel(string ,0x33CCFFAA,0, 0, 0,15,INVALID_PLAYER_ID, VoziloInfo[vID] ,0,-1,-1,-1,15);
            /*new modelv[24];
            ImenaVozila[GetVehicleModel(vozilo) - 400]

            new stringau[256];
                new vid = ceneAuta(GetVehicleModel(VoziloInfo[vID]));
            GetVehicleName(VoziloInfo[vID],modelv,sizeof(modelv));
            format(stringau,sizeof(stringau),""PLAVA"Auto na prodaju!\nModel: {FFFFFF}%s\n"PLAVA"Cena: {FFFFFF}$%d\n"PLAVA"Da kupite auto {FFFFFF}/kupiauto",modelv,AutoSalon[vid][1]);
               VehicleLabel[VoziloInfo[vID]] = CreateDynamic3DTextLabel(stringau, 0xFF0000CC, 0.0, 0.0, 0.5, 10.0, INVALID_PLAYER_ID, VoziloInfo[vID], 0, -1, -1, -1, 100.0);
            */
            }
      }
   }[/pawn] dio skripte o tome

1. ako nemas, napisi kod da se autu promijeni label ako mu se dodijeli vlasnik
2. kad kucas /kupiauto i ako ga kupis, postavi mu da se parkira na trenutnim kordinatama i da se respawnuje, tako ces update label

ja vec oko par sati pokusavam to rijesit i erori iskacu dali bi mogao ti ako ti nebi bio problem da to napises da to ubacim sad sam probao mimo cmd kad kupim auto da ga rtcam i opet ostane taj lable .


Citat: Tebrix poslato Novembar 13, 2022, 19:12:51 POSLE PODNE
1. ako nemas, napisi kod da se autu promijeni label ako mu se dodijeli vlasnik
2. kad kucas /kupiauto i ako ga kupis, postavi mu da se parkira na trenutnim kordinatama i da se respawnuje, tako ces update label
On zeli da se obrise label cim kupi auto ne da update.

Jesi probao mozda kada kupis auto da napises ovo ispod?

[pawn]DestroyDynamic3DTextLabel(VehicleLabel);[/pawn]
Poslednja Izmena: Novembar 14, 2022, 13:52:12 POSLE PODNE od Goku ^

stavio sam vako to i opet nista rtcam auto parkiram opet ostane da li ovo je dio od servera Ghetto 1.7 by Nestro ako to moze nekako pomoc da znas [pawn]IzlozbenoAuto = CreateVehicle(AutoSalon[AutoModel][0], AIZLOZBENO_X,AIZLOZBENO_Y,AIZLOZBENO_Z,AIZLOZBENO_A, 2, 2, 30000);
   for(new i = 0; i < sizeof(VoziloInfo); i++)
   {
      new vFile[50];
        format(vFile, sizeof(vFile), AUTO_FILE, i);
        if(fexist(vFile))
        {
            INI_ParseFile(vFile, "UcitajVozila", .bExtra = true, .extra = i);
            VoziloInfo[vID] = CreateVehicle(VoziloInfo[vModel],VoziloInfo[vPozX],VoziloInfo[vPozY],VoziloInfo[vPozZ],VoziloInfo[vPozA],VoziloInfo[vBoja1],VoziloInfo[vBoja2],30000);
           SetVehicleModifications(i, VoziloInfo[vID]);

            if(VoziloInfo[vImaVlasnika] == 0)
            {
            new string[300];
            new vid = ceneAuta(VoziloInfo[vModel]); //AutoSalon[vid][1]
            format(string,sizeof(string),""PLAVA"[Auto na prodaju]\nModel: "BELA"%s\n"PLAVA"Cena: "BELA"%d$\n"PLAVA"Da kupite auto "BELA"/kupiauto",VoziloInfo[vModelV],AutoSalon[vid][1]);
            VehicleLabel = CreateDynamic3DTextLabel(string ,0x33CCFFAA,0, 0, 0,15,INVALID_PLAYER_ID, VoziloInfo[vID] ,0,-1,-1,-1,15);
            DestroyDynamic3DTextLabel(VehicleLabel);
            /*new modelv[24];
            ImenaVozila[GetVehicleModel(vozilo) - 400]

            new stringau[256];
                new vid = ceneAuta(GetVehicleModel(VoziloInfo[vID]));
            GetVehicleName(VoziloInfo[vID],modelv,sizeof(modelv));
            format(stringau,sizeof(stringau),""PLAVA"Auto na prodaju!\nModel: {FFFFFF}%s\n"PLAVA"Cena: {FFFFFF}$%d\n"PLAVA"Da kupite auto {FFFFFF}/kupiauto",modelv,AutoSalon[vid][1]);
               VehicleLabel[VoziloInfo[vID]] = CreateDynamic3DTextLabel(stringau, 0xFF0000CC, 0.0, 0.0, 0.5, 10.0, INVALID_PLAYER_ID, VoziloInfo[vID], 0, -1, -1, -1, 100.0);
            */
            }
      }
   }[/pawn]

Citat: Markoo00 poslato Novembar 14, 2022, 19:47:27 POSLE PODNE
stavio sam vako to i opet nista rtcam auto parkiram opet ostane da li ovo je dio od servera Ghetto 1.7 by Nestro ako to moze nekako pomoc da znas [pawn]IzlozbenoAuto = CreateVehicle(AutoSalon[AutoModel][0], AIZLOZBENO_X,AIZLOZBENO_Y,AIZLOZBENO_Z,AIZLOZBENO_A, 2, 2, 30000);
   for(new i = 0; i < sizeof(VoziloInfo); i++)
   {
      new vFile[50];
        format(vFile, sizeof(vFile), AUTO_FILE, i);
        if(fexist(vFile))
        {
            INI_ParseFile(vFile, "UcitajVozila", .bExtra = true, .extra = i);
            VoziloInfo[vID] = CreateVehicle(VoziloInfo[vModel],VoziloInfo[vPozX],VoziloInfo[vPozY],VoziloInfo[vPozZ],VoziloInfo[vPozA],VoziloInfo[vBoja1],VoziloInfo[vBoja2],30000);
           SetVehicleModifications(i, VoziloInfo[vID]);

            if(VoziloInfo[vImaVlasnika] == 0)
            {
            new string[300];
            new vid = ceneAuta(VoziloInfo[vModel]); //AutoSalon[vid][1]
            format(string,sizeof(string),""PLAVA"[Auto na prodaju]\nModel: "BELA"%s\n"PLAVA"Cena: "BELA"%d$\n"PLAVA"Da kupite auto "BELA"/kupiauto",VoziloInfo[vModelV],AutoSalon[vid][1]);
            VehicleLabel = CreateDynamic3DTextLabel(string ,0x33CCFFAA,0, 0, 0,15,INVALID_PLAYER_ID, VoziloInfo[vID] ,0,-1,-1,-1,15);
            DestroyDynamic3DTextLabel(VehicleLabel);
            /*new modelv[24];
            ImenaVozila[GetVehicleModel(vozilo) - 400]

            new stringau[256];
                new vid = ceneAuta(GetVehicleModel(VoziloInfo[vID]));
            GetVehicleName(VoziloInfo[vID],modelv,sizeof(modelv));
            format(stringau,sizeof(stringau),""PLAVA"Auto na prodaju!\nModel: {FFFFFF}%s\n"PLAVA"Cena: {FFFFFF}$%d\n"PLAVA"Da kupite auto {FFFFFF}/kupiauto",modelv,AutoSalon[vid][1]);
               VehicleLabel[VoziloInfo[vID]] = CreateDynamic3DTextLabel(stringau, 0xFF0000CC, 0.0, 0.0, 0.5, 10.0, INVALID_PLAYER_ID, VoziloInfo[vID], 0, -1, -1, -1, 100.0);
            */
            }
      }
   }[/pawn]
DestroyDynamic3DTextLabel(VehicleLabel); stavljas kod komande /kupivozilo ne tu.

nece cabe upisem i nista [pawn]YCMD:kupiauto(playerid, params[], help)
{
   #pragma unused help
   #pragma unused params
   if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,""PLAVA"(NS:RP) "SIVA"Morate biti ulogovani da bi koristili komande!");
   if(PlayerInfo[playerid][pPosedovanjeAuta] != -1) return SCM(playerid,-1,""SIVA"Vec posedujes auto!");
   if(PlayerInfo[playerid][pLevel] < 3) return SCM(playerid,-1,""SIVA"Morate biti level 3+ za kupovinu auta!");
   if(IsPlayerInRangeOfPoint(playerid, 5.0, 1465.5938,-1749.7264,15.4453))
   {
      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(autokatalog != 0) return SCM(playerid,-1,""SIVA"Neko vec pregleda katalog!");
      if(prodajav != 0) return SCM(playerid,-1,""SIVA"Sva vozila su rasprodata!");
      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, ""ZUTA"[NS:RP] "PLAVA"Koristite tipke LEVO i DESNO za listanje vozila!");
      SCM(playerid, -1, ""ZUTA"[NS:RP] "PLAVA"Za kupovinu stisnite ENTER ili F!");
      SCM(playerid, -1, ""ZUTA"[NS:RP] "PLAVA"Za izlaz stisnite SHIFT!");
      SetPlayerCameraPos(playerid, 1465.5938,-1749.7264,15.4453);
       SetPlayerCameraLookAt(playerid, 1465.5938,-1749.7264,15.4453);
    }
    else if(UsaoAutoProdaja[playerid] != -1)
    {
        new i = UsaoAutoProdaja[playerid];
        if(VoziloInfo[vImaVlasnika] == 0)
      {
          new vid = ceneAuta(GetVehicleModel(GetPlayerVehicleID(playerid)));
          if(PlayerInfo[playerid][pNovacDzep] < AutoSalon[vid][1]) return SCM(playerid,-1,""SIVA"Nemate dovoljno novca!");
          g_NovacMinus(playerid, AutoSalon[vid][1]);
         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);
           new textjbni[512]; format(textjbni, sizeof(textjbni),""CRVENA"NS:RP | "BELA"Uspesno ste kupili auto za %d$ novca!",AutoSalon[vid][1]);SCM(playerid, -1, textjbni);
           UsaoAutoProdaja[playerid] = -1;
              //new cosvls = GetPlayerVehicleID(playerid);
           DestroyDynamic3DTextLabel(VehicleLabel);
      }
      else return SCM(playerid,-1,""CRVENA"NS:RP | "SIVA"To vozilo nije na prodaju!");
    }
   return 1;
}[/pawn]

[pawn]new i = UsaoAutoProdaja[playerid];[/pawn]
Pošalji kod gdje dodjeljuješ vrijednost varijabli UsaoAutoProdaja

evo mislim da si na to mislio
[pawn]public OnPlayerStateChange(playerid, newstate, oldstate)
{
   new textjbni[512];
   new vozilo = GetPlayerVehicleID(playerid);
    if(!VoziloJeBicikla(GetVehicleModel(GetPlayerVehicleID(playerid))))
   {
      new string[128];
      if(oldstate-1 && newstate) HideSpeedo(playerid); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[3][playerid]), format(string, sizeof(string), "%d l", Fuel[GetPlayerVehicleID(playerid)]), PlayerTextDrawSetString(playerid, BRZINOMER[3][playerid], string),PrikaziSpeedo(playerid);
   }
   //new test = GetVehicleModel(GetPlayerVehicleID(playerid));
   if(newstate == PLAYER_STATE_DRIVER)
   {
       for(new i = 0; i < sizeof(VoziloInfo); i++)
       {
         if(VoziloInfo[vID] == vozilo)
         {
              new cena = ceneAuta(GetVehicleModel(GetPlayerVehicleID(playerid)));
            if(VoziloInfo[vImaVlasnika] == 0)
            {
                if(PlayerInfo[playerid][pAdmin] >= 6) //new textjbni[512];
                {
               format(textjbni, sizeof(textjbni),"[NS:RP] "PLAVA"Ulazite u vozilo ID: %d!",i);SCM(playerid, -1, textjbni);
               }
               SCM(playerid,-1,""CRVENA"Auto na prodaju | /kupiauto | /izlaz");
               format(textjbni, sizeof(textjbni),""CRVENA"cena: "BELA"%d$ | "CRVENA"Model: "BELA"%s",AutoSalon[cena][1], ImenaVozila[GetVehicleModel(vozilo) - 400]);SCM(playerid, -1, textjbni);
               UsaoAutoProdaja[playerid] = i; TogglePlayerControllable(playerid, 0);
               return 1;
            }
         }
      }
      for(new i = 0; i < sizeof(MotorInfo); i++)
       {
         if(MotorInfo[mID] == vozilo)
         {
            if(MotorInfo[mImaVlasnika] == 0)
            {
                if(PlayerInfo[playerid][pAdmin] >= 6) //new textjbni[512];
                {
               format(textjbni, sizeof(textjbni),"[NS:RP] "PLAVA"Ulazite u motor ID: %d!",i);SCM(playerid, -1, textjbni);
               freeze[playerid] = SetTimerEx("Freeze",3000, false, "i", playerid);
               }
               SCM(playerid,-1,""PLAVA"(NS:RP) "BELA"Motor na prodaju | /kupimotor | /izlaz");
               format(textjbni, sizeof(textjbni),""PLAVA"Cena: "BELA"%d$ "PLAVA"Model: "BELA"%s",MotorInfo[mcena], ImenaVozila[GetVehicleModel(vozilo) - 400]);SCM(playerid, -1, textjbni);
               UsaoMotorProdaja[playerid] = i; TogglePlayerControllable(playerid, 0);
               return 1;
            }
         }
      }[/pawn]