Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Besha_Cappone poslato Avgust 14, 2020, 10:06:03 PRE PODNE

Naslov: Brzinomer
Poruka od: Besha_Cappone poslato Avgust 14, 2020, 10:06:03 PRE PODNE
Problem(error/warning): Ovako, ubacio brzinomer, izmenio ono gorvio, i to, pobrisao ono N-R-D, kad udjem IG, brzinomer nije to to, ja smatram da je do definicije, evo slicice https://imgur.com/a/pmgtbi9
Deo skripte: [pawn]      new string[128];
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[0][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[0][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[1][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[1][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[2][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[2][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[10][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[10][playerid]), format(string, sizeof(string), "Gorivo: ~w~%d L", Fuel[GetPlayerVehicleID(playerid)]), PlayerTextDrawSetString(playerid, BRZINOMER[10][playerid], string);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[4][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[4][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[5][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[5][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[6][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[6][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[7][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[7][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[8][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[8][playerid]);
      if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[9][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[9][playerid]);
      [/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): Nista

Naslov: Odg: Brzinomer
Poruka od: XACK poslato Avgust 14, 2020, 11:22:40 PRE PODNE
[pawn]if(newstate == PLAYER_STATE_DRIVER)
{
// ovo ce biti tacno kada igrac sedne u kola
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
// ovo kada izadje sa mesta vozaca
}


// Ovo ti je efektivniji nacin za prikazivanje/skrivanje textdraw-ova koji su u array-u


// skrivanje brzinomera
for(new i; i < sizeof BRZINOMER; i++)
{
   PlayerTextDrawHide(playerid, BRZINOMER[playerid]);
}

//prikazivanje brzinomera

for(new i; i < sizeof BRZINOMER; i++)
{
   PlayerTextDrawShow(playerid, BRZINOMER[playerid]);
}[/pawn]


Sada je ostalo samo jedno pitanje: Kako si kreirao textdrawove? Mogao bi nam poslatio deo ili sve pa cemo ti dalje pomoci, jer po izgledu na slici izgleda kao da si prikazao td iz praznog array-a.
Naslov: Odg: Brzinomer
Poruka od: Besha_Cappone poslato Avgust 14, 2020, 21:17:50 POSLE PODNE
[pawn]BRZINOMER[playerid][0] = CreatePlayerTextDraw(playerid, 395.778076, 376.168457, "box");
PlayerTextDrawLetterSize(playerid, BRZINOMER[playerid][0], 0.000000, 5.244443);
PlayerTextDrawTextSize(playerid, BRZINOMER[playerid][0], 516.000000, 0.000000);
PlayerTextDrawAlignment(playerid, BRZINOMER[playerid][0], 1);
PlayerTextDrawColor(playerid, BRZINOMER[playerid][0], -1);
PlayerTextDrawUseBox(playerid, BRZINOMER[playerid][0], 1);
PlayerTextDrawBoxColor(playerid, BRZINOMER[playerid][0], 190);
PlayerTextDrawSetShadow(playerid, BRZINOMER[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, BRZINOMER[playerid][0], 255);
PlayerTextDrawFont(playerid, BRZINOMER[playerid][0], 1);
PlayerTextDrawSetProportional(playerid, BRZINOMER[playerid][0], 1);[/pawn]

Ako mislis na ovo, ako si free mozemo discord ili ts, pa da resimo to 
Naslov: Odg: Brzinomer
Poruka od: Slade poslato Avgust 14, 2020, 22:14:15 POSLE PODNE
Replace svoj kod sa ovim:

[pawn]new string[17];
format(string, sizeof(string), "Gorivo: ~w~%d L", Fuel[GetPlayerVehicleID(playerid)]),
PlayerTextDrawSetString(playerid, BRZINOMER[playerid][10], string);
for(new i; i < 10; i++) PlayerTextDrawShow(playerid, BRZINOMER[playerid]);[/pawn]

Ne možeš definisati & kreirati kao BRZINOMER[playerid][0] a koristiti kao BRZINOMER[0][playerid]
Također, tekst TextDrawa prvo izmjeni, zatim prikazi textdraw, ne obrnuto.
Naslov: Odg: Brzinomer
Poruka od: mattazz poslato Avgust 20, 2020, 16:53:41 POSLE PODNE
Ne može se definisati & kreirati kao BRZINOMER[playerid][0] a definisan je kao BRZINOMER[0][playerid]
Također tekst TextDrawa prvo izmeni zatim prikazi textdraw, ne moze obrnuto.

(https://www.dodaj.rs/images/maxy-bsampa196e3a1d8a7e73b.png)
Naslov: Odg: Brzinomer
Poruka od: Besha_Cappone poslato Avgust 20, 2020, 21:04:07 POSLE PODNE
Citat: _maxy poslato Avgust 20, 2020, 16:53:41 POSLE PODNE
Ne može se definisati & kreirati kao BRZINOMER[playerid][0] a definisan je kao BRZINOMER[0][playerid]
Također tekst TextDrawa prvo izmeni zatim prikazi textdraw, ne moze obrnuto.

(https://www.dodaj.rs/images/maxy-bsampa196e3a1d8a7e73b.png)
Jesi slobodan? Da posaljem kompletan mod, evo zezam se vec 3-4d jednostavno, oko ovog se ne razumijem.
Naslov: Odg: Brzinomer
Poruka od: mattazz poslato Avgust 22, 2020, 13:52:22 POSLE PODNE
Ajd posalji mi,pa cu fixati
Naslov: Odg: Brzinomer
Poruka od: skripte iz 2007 godine. ( ͡° ͜ʖ ͡°) poslato Avgust 23, 2020, 09:39:26 PRE PODNE
learn basics