Pitanje

Započeo Rex, Decembar 04, 2021, 11:28:31 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Rex

*

Problem(error/warning): Kako da prikazem vozila na textdraw kada igrac udje u auto
Deo skripte: [pawn]   
new modelid = GetVehicleModel(vehicleid);
PlayerTextDrawSetPreviewModel(playerid, fortztde_PTD[playerid][8], modelid);
PlayerTextDrawSetPreviewRot(playerid, fortztde_PTD[playerid][8], 0.000000, 0.000000, 30.000000, 1.000000);
PlayerTextDrawSetPreviewVehCol(playerid, fortztde_PTD[playerid][8], 1, 1);/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [pawn]jok[/pawn]
Slika/video ingame problema(obavezno ako je ingame problem): nije potrebna slika.
Poslednja Izmena: Decembar 05, 2021, 23:32:36 POSLE PODNE od мυмα

public OnPlayerStateChange

provjeris da li je oldstate ONFOOT i newstate VEHICLE DRIVER
i ako je onda prikaze
u istom tom publicu
provjeris da li je oldstate vehicle driver
i onda maknes tdove

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Rex

*

Citat: Common poslato Decembar 04, 2021, 11:39:09 PRE PODNE
public OnPlayerStateChange

provjeris da li je oldstate ONFOOT i newstate VEHICLE DRIVER
i ako je onda prikaze
u istom tom publicu
provjeris da li je oldstate vehicle driver
i onda maknes tdove
Uradio sam, ali stavi sliku proslog auta pa moras da izadjes iz auta pa da ponovo udjes da bi setovalo tacnu sliku.

pa koristi playertextdrawsetpreviewmodel cim udje u vozilo

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Rex

*

Citat: Common poslato Decembar 04, 2021, 14:09:11 POSLE PODNE
pa koristi playertextdrawsetpreviewmodel cim udje u vozilo
Evo ti ceo OnPlayerStateChange, objasni sta je problem ovde. Njemu se pojave textdrawi kad udje u auto ali ne pojavi se tacna slika auta vec se pojavi slika od auta koje je proslo vozio, npr: Sedeo u mower i predje u sentinel, pojavi se slika mowera
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
   {
      ShowSpeedometar(playerid);
       new vehid = GetPlayerVehicleID(playerid);
       new modelid = GetVehicleModel(vehid);
      PlayerTextDrawSetPreviewModel(playerid, fortztde_PTD[playerid][8], modelid);
      PlayerTextDrawSetPreviewRot(playerid, fortztde_PTD[playerid][8], 0.000000, 0.000000, 30.000000, 1.000000);
      PlayerTextDrawSetPreviewVehCol(playerid, fortztde_PTD[playerid][8], 1, 1);
      if(VehInfo[vehid][vEngine] == 0)
      {
          SCM(playerid, COLOR_LIGHTBLUE, "Ako zelite da upalite motor pritisnite 2 ili komandom /engine");
      }
      for(new i = 0; i < 5; i++)
      {
          if(vehid == KosacVeh)
          {
            if(PlayerInfo[playerid][pPosao] == 1)
            {
                if(radi[playerid] == 0)
               {
                  SCM(playerid, COLOR_LIGHTBLUE, "[BL:RP]:{FFFFFF} Ako zelite da radite /kositravu!");
               }
               else
               {
                   SCM(playerid, COLOR_LIGHTBLUE, "[BL:RP]:{FFFFFF} Vec radite neki posao, prvo ga morate prekinuti! /prekiniposao");
               }
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SCM(playerid, COLOR_LIGHTBLUE, "[BL:RP]:{FFFFFF}Niste zaposleni kao kosac trave");
            }
          }
      }
   }
   if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
   {
       HideSpeedometar(playerid);
   }
   return 1;
}

Sve promjene (sem SetString) textdrawova moras da updateuje funkcijom Show.


PlayerTextDrawSetPreviewModel(playerid, fortztde_PTD[playerid][8], modelid);
PlayerTextDrawSetPreviewRot(playerid, fortztde_PTD[playerid][8], 0.000000, 0.000000, 30.000000, 1.000000);
PlayerTextDrawSetPreviewVehCol(playerid, fortztde_PTD[playerid][8], 1, 1);

PlayerTextDrawShow(playerid, fortztde_PTD[playerid][8]);

Rex

*

Citat: // xunder poslato Decembar 04, 2021, 15:34:00 POSLE PODNE
Sve promjene (sem SetString) textdrawova moras da updateuje funkcijom Show.
To ShowSpedometar je samo stock koji prikazuje textdrawe, sta moram da updajtam? Gde da stavim to SetPreviewModel i ostalo? U stock ShowSpeedometar?


PlayerTextDrawSetPreviewModel(playerid, fortztde_PTD[playerid][8], modelid);
PlayerTextDrawSetPreviewRot(playerid, fortztde_PTD[playerid][8], 0.000000, 0.000000, 30.000000, 1.000000);
PlayerTextDrawSetPreviewVehCol(playerid, fortztde_PTD[playerid][8], 1, 1);

PlayerTextDrawShow(playerid, fortztde_PTD[playerid][8]);


Ne, nego pod onplayerstate change pa ono kad tek udje

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi


Rex

*

Citat: // xunder poslato Decembar 04, 2021, 17:44:14 POSLE PODNE
Sta tacno nisi razumio kod mog objasnjena?
Nisam razumeo gde da stavim to SetTextdrawPreviewModel()?u stock ili pod OnPlayerStateChange() kada udje u auto?

pod onplayerstatechange

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Rex

*

Citat: Common poslato Decembar 04, 2021, 19:53:07 POSLE PODNE
pod onplayerstatechange
Pa tu i stoji???I I i dalje prikazuje sliku auta u kojem je igrac bio pre nego sto je usao u novi auto

pa treba ti playertextdrawshow jel si slijep? Fino ti je napisao i ti pitas gdje treba pa ne ubacis

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi

Rex

*

Citat: Common poslato Decembar 04, 2021, 20:01:16 POSLE PODNE
pa treba ti playertextdrawshow jel si slijep? Fino ti je napisao i ti pitas gdje treba pa ne ubacis
Hmm cemu onda sluzi ShowSpeedometar() na pocetku OnPlayerStateChange? Jel mozda treba prvo da setam preview model pa da prikazem textdrawe?

pa eto mozes onda i tako prvo setpreviewmodel pa onda show stock

[Filterscript] Simple Treasure Hunt
[Filterscript] Sistem pecanja
[Filterscript] Meditacija
[Filterscript] Molitva
[Include] Alarm
[Include] Posao Taxi