Problem(error/warning): Dakle imam td, nap sam i sve spojio KM/H, mjeri Gorivo mjeri, i sve pet, ali ima problem, kada igrac udje u auto da mu pokaze taj td, to skripta i uradi, ali kada igrac izadje iz tog auta ostane taj td i ne zeli da se skloni, stavio sam i provjeru ako je igrac na nogama da mu hide-a td isto sve, pokusao sam i td destroy isto, ako neko zna odg zahvalan sam
Deo skripte: [pawn]//[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Evo ti primer jedan kako mozes da radis npr (tako sam ja)
[pawn]
stock CreateSpeedoTextDraws(const playerid, bool: status)
{
if (!status) {
// ovde stavis da ti se uniste svi tdovi...
return 1;
}
// ovde stavis kreiranje svih tdova
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
return 1;
}
[/pawn]
[pawn]stock CreateSpeedoTextDraws(const playerid, bool: status)
{
if (!status)
{
for(new i = 0; i < 14; i++)
{
PlayerTextDrawDestroy(playerid, Brzinomer[playerid]);
}
return 1;
}
for(new i = 0; i < 14; i++)
{
PlayerTextDrawShow(playerid, Brzinomer[playerid]);
}
return 1;
}
// ovo sam ubacio u onplayerstatechange i isto sve ne skloni ga
{
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
}[/pawn]
Citat: Davor_Malovic poslato April 30, 2021, 12:07:14 POSLE PODNE
[pawn]stock CreateSpeedoTextDraws(const playerid, bool: status)
{
if (!status)
{
for(new i = 0; i < 14; i++)
{
PlayerTextDrawDestroy(playerid, Brzinomer[playerid]);
}
return 1;
}
for(new i = 0; i < 14; i++)
{
PlayerTextDrawShow(playerid, Brzinomer[playerid]);
}
return 1;
}
// ovo sam ubacio u onplayerstatechange i isto sve ne skloni ga
{
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
}[/pawn]
tu gde ih prikazujes prvo iznad treba da ih napravis pa onda ispod prikazes
Citat: Davor_Malovic poslato April 30, 2021, 12:07:14 POSLE PODNE
[pawn]stock CreateSpeedoTextDraws(const playerid, bool: status)
{
if (!status)
{
for(new i = 0; i < 14; i++)
{
PlayerTextDrawDestroy(playerid, Brzinomer[playerid]);
}
return 1;
}
for(new i = 0; i < 14; i++)
{
PlayerTextDrawShow(playerid, Brzinomer[playerid]);
}
return 1;
}
// ovo sam ubacio u onplayerstatechange i isto sve ne skloni ga
{
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
}[/pawn]
Ne skloni se jer koristiš destroy, moraš hide prvo + po tom što si napisao od koda kad ih uništiš nećeš ih moći vidjeti više, moraš ih kreirati svaki put pa prikazat ako si ih prethodno uništio
Pokusao sam i PlayerTextDrawHide isto
stock CreateSpeedoTextDraws(const playerid, bool: status)
{
if (!status) {
for(new i = 0; i < 14; i++) {
PlayerTextDrawHide(playerid, Brzinomer[playerid]);
}
return 1;
}
for(new i = 0; i < 14; i++) {
PlayerTextDrawShow(playerid, Brzinomer[playerid]);
}
return 1;
}
hook OnPlayerStateChange(playerid, newstate, oldstate) {
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
return 1;
}
Vidi jel ti ovako ko u vedrana ako jes i ne radi baci neki print da vidiš jel ulazi u stock ako neće vidi crashdetect da nije array sjeban ili nešto myb ti onplayerstatechange pukne negdje
[pawn] PlayerTextDrawHide(playerid, Brzinomer[playerid]);
PlayerTextDrawShow(playerid, Brzinomer[playerid]);
2 errora vjvr zbog jer fali error 035: argument type mismatch (argument 2)
error 035: argument type mismatch (argument 2)[/pawn]
Citat: 'xza poslato April 30, 2021, 13:27:07 POSLE PODNE
Vidi jel ti ovako ko u vedrana ako jes i ne radi baci neki print da vidiš jel ulazi u stock ako neće vidi crashdetect da nije array sjeban ili nešto myb ti onplayerstatechange pukne negdje
Pokusao sam da posaljem poruku igracu kao test 123 radi na Pokazivanju TD-A tek kada udje u auto, ali kada izadje ne posalje uopste poruku
[pawn][13:41:45] [debug] Run time error 4: "Array index out of bounds"
[13:41:45] [debug] Attempted to read/write array element at index 12 in array of size 12
[13:41:45] [debug] AMX backtrace:
[13:41:45] [debug] #0 003a1bec in ?? (0, 1) in agrp.amx
[13:41:45] [debug] #1 0037af88 in public WC_OnPlayerStateChange (0, 2, 1) in agrp.amx
[13:41:45] [debug] #2 0005d2dc in public FIXES_OnPlayerStateChange (0, 2, 1) in agrp.amx
[13:41:45] [debug] #3 000080c0 in public OnPlayerStateChange (0, 2, 1) in agrp.amx[/pawn]
ovo je iz server loga
Ima i kod njeg [ i ] samo je to bbcode na forumu pa ne vidiš
Daj kompletan onplayerstatechange
CreateSpeedoTextDraws(playerid, true);
Probaj ovako, ovo ti nece sakriti td kad izadjes iz vozila ali vidi da li ce ga uopste prikazati
Pokaze njega i pokusao sam printf da kada udje u vozilo, ispisuje u logu to sto sam napisao u printf, a stavio sam i kada izadje da bude printf nista ne pokazuje samo gore stoji onaj dio sto sam poslao onplayerstatechange....
covece...
https://fiddle.sa-mp.dev/CustomaryCondescendingAfricanparadiseflycatcher
Isto sve
Citat: Davor_Malovic poslato April 30, 2021, 14:55:42 POSLE PODNE
Isto sve
Onda je problem negde drugde jer ja onako koristim u svom modu i sve mi perfektno radi :)
Sve sam uradio kao sto si rekao nezz sto nece, da nije do onplayerstatechange ?
Citat: Davor_Malovic poslato April 30, 2021, 13:44:26 POSLE PODNE
[pawn][13:41:45] [debug] Run time error 4: "Array index out of bounds"
[13:41:45] [debug] Attempted to read/write array element at index 12 in array of size 12
[13:41:45] [debug] AMX backtrace:
[13:41:45] [debug] #0 003a1bec in ?? (0, 1) in agrp.amx
[13:41:45] [debug] #1 0037af88 in public WC_OnPlayerStateChange (0, 2, 1) in agrp.amx
[13:41:45] [debug] #2 0005d2dc in public FIXES_OnPlayerStateChange (0, 2, 1) in agrp.amx
[13:41:45] [debug] #3 000080c0 in public OnPlayerStateChange (0, 2, 1) in agrp.amx[/pawn]
Daj full kod msm da si samo loop sjebao
Slao je meni priv callback, unutar if (newstate == inveh) je ubacio funkciju gore tkd se nije mogla ni povuć kad izađe iz vozila još return ima pa ako bude fixao šta nek piše
Ako si fix lock, ako nisi daj trenutni kod posto stvarno necu da nagadjam sta je i kako je.
Daj kako prikazujes, daj kako sakrivas i daj sve vezano za te TD-ove.
[pawn]static PlayerText: BrzinometarTD[MAX_PLAYERS][12];
BrzinometarTD[playerid][0] = CreatePlayerTextDraw(playerid, 528.101562, 353.450286, "Amazon_Gaming");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][0], 0.398124, 1.594164);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][0], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][0], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][0], 3);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][0], 1);
BrzinometarTD[playerid][1] = CreatePlayerTextDraw(playerid, 499.897399, 365.000091, "box");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][1], 0.000000, 6.345532);
PlayerTextDrawTextSize(playerid, BrzinometarTD[playerid][1], 628.000000, 0.000000);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][1], -1);
PlayerTextDrawUseBox(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawBoxColor(playerid, BrzinometarTD[playerid][1], -926404046);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][1], 0);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][1], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][1], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][1], 0);
BrzinometarTD[playerid][2] = CreatePlayerTextDraw(playerid, 501.671661, 369.633209, "ime_auta");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][2], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][2], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][2], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][2], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][2], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][2], 1);
BrzinometarTD[playerid][3] = CreatePlayerTextDraw(playerid, 502.071624, 382.233551, "brzina");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][3], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][3], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][3], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][3], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][3], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][3], 1);
BrzinometarTD[playerid][4] = CreatePlayerTextDraw(playerid, 501.597961, 395.433898, "gorivo");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][4], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][4], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][4], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][4], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][4], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][4], 1);
BrzinometarTD[playerid][5] = CreatePlayerTextDraw(playerid, 501.403289, 408.450592, "radio");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][5], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][5], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][5], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][5], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][5], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][5], 1);
BrzinometarTD[playerid][6] = CreatePlayerTextDraw(playerid, 551.872070, 369.633209, "sultan");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][6], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][6], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][6], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][6], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][6], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][6], 1);
BrzinometarTD[playerid][7] = CreatePlayerTextDraw(playerid, 542.464782, 382.233551, "220");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][7], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][7], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][7], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][7], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][7], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][7], 1);
BrzinometarTD[playerid][8] = CreatePlayerTextDraw(playerid, 543.690856, 395.433898, "200");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][8], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][8], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][8], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][8], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][8], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][8], 1);
BrzinometarTD[playerid][9] = CreatePlayerTextDraw(playerid, 548.095092, 408.450592, "45");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][9], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][9], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][9], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][9], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][9], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][9], 1);
BrzinometarTD[playerid][10] = CreatePlayerTextDraw(playerid, 562.286315, 395.433898, "l");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][10], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][10], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][10], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][10], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][10], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][10], 1);
BrzinometarTD[playerid][11] = CreatePlayerTextDraw(playerid, 563.159729, 382.233551, "KM/H");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][11], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][11], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][11], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][11], 1);+
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][11], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][11], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][11], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][11], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][11], 1);
// onplayerstatechange
{
CreateSpeedoTextDraws(playerid, (newstate == PLAYER_STATE_DRIVER ? (true) : (false)));
}
if( newstate == PLAYER_STATE_DRIVER )
{
new veh[30];
format(veh, sizeof(veh), "%s", VehicleNames[GetVehicleModel(vehicle)-400]);
PlayerTextDrawSetString(playerid, BrzinometarTD[playerid][6], veh);
}
// ovo sam stavio kod nekih stock
stock CreateSpeedoTextDraws(const playerid, bool: status = true)
{
if (!status){
for (new i = 0; i < 12; ++i){
PlayerTextDrawDestroy(playerid, BrzinometarTD[playerid]);
}
return 1;
}
BrzinometarTD[playerid][0] = CreatePlayerTextDraw(playerid, 528.101562, 353.450286, "Amazon_Gaming");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][0], 0.398124, 1.594164);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][0], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][0], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][0], 3);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][0], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][0], 1);
BrzinometarTD[playerid][1] = CreatePlayerTextDraw(playerid, 499.897399, 365.000091, "box");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][1], 0.000000, 6.345532);
PlayerTextDrawTextSize(playerid, BrzinometarTD[playerid][1], 628.000000, 0.000000);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][1], -1);
PlayerTextDrawUseBox(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawBoxColor(playerid, BrzinometarTD[playerid][1], -926404046);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][1], 0);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][1], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][1], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][1], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][1], 0);
BrzinometarTD[playerid][2] = CreatePlayerTextDraw(playerid, 501.671661, 369.633209, "ime_auta");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][2], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][2], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][2], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][2], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][2], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][2], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][2], 1);
BrzinometarTD[playerid][3] = CreatePlayerTextDraw(playerid, 502.071624, 382.233551, "brzina");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][3], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][3], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][3], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][3], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][3], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][3], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][3], 1);
BrzinometarTD[playerid][4] = CreatePlayerTextDraw(playerid, 501.597961, 395.433898, "gorivo");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][4], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][4], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][4], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][4], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][4], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][4], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][4], 1);
BrzinometarTD[playerid][5] = CreatePlayerTextDraw(playerid, 501.403289, 408.450592, "radio");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][5], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][5], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][5], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][5], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][5], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][5], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][5], 1);
BrzinometarTD[playerid][6] = CreatePlayerTextDraw(playerid, 551.872070, 369.633209, "sultan");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][6], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][6], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][6], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][6], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][6], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][6], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][6], 1);
BrzinometarTD[playerid][7] = CreatePlayerTextDraw(playerid, 542.464782, 382.233551, "220");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][7], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][7], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][7], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][7], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][7], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][7], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][7], 1);
BrzinometarTD[playerid][8] = CreatePlayerTextDraw(playerid, 543.690856, 395.433898, "200");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][8], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][8], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][8], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][8], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][8], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][8], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][8], 1);
BrzinometarTD[playerid][9] = CreatePlayerTextDraw(playerid, 548.095092, 408.450592, "45");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][9], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][9], -5963521);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][9], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][9], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][9], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][9], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][9], 1);
BrzinometarTD[playerid][10] = CreatePlayerTextDraw(playerid, 562.286315, 395.433898, "l");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][10], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][10], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][10], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][10], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][10], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][10], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][10], 1);
BrzinometarTD[playerid][11] = CreatePlayerTextDraw(playerid, 563.159729, 382.233551, "KM/H");
PlayerTextDrawLetterSize(playerid, BrzinometarTD[playerid][11], 0.247261, 1.366667);
PlayerTextDrawAlignment(playerid, BrzinometarTD[playerid][11], 1);
PlayerTextDrawColor(playerid, BrzinometarTD[playerid][11], -1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][11], 1);+
PlayerTextDrawSetOutline(playerid, BrzinometarTD[playerid][11], 0);
PlayerTextDrawBackgroundColor(playerid, BrzinometarTD[playerid][11], 255);
PlayerTextDrawFont(playerid, BrzinometarTD[playerid][11], 2);
PlayerTextDrawSetProportional(playerid, BrzinometarTD[playerid][11], 1);
PlayerTextDrawSetShadow(playerid, BrzinometarTD[playerid][11], 1);
for (new i = 0; i < 12; ++i) {
PlayerTextDrawShow(playerid, BrzinometarTD[playerid]);
}
return 1;
}
// onplayerupdate
if(IsPlayerInAnyVehicle(playerid)&& GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
if(!IsABicycle(vehicle))
{
new string[30];
format(string, sizeof(string), "~r~%d ", GetPlayerSpeed(playerid, true));
PlayerTextDrawSetString(playerid, BrzinometarTD[playerid][7], string);
new string1[30];
format(stringj, sizeof(string), "~r~%dL", Fuel[vehicle]);
PlayerTextDrawSetString(playerid, BrzinometarTD[playerid][8], string);
new string2[30];
format(string2, sizeof(string2), "%s", VehicleNames[GetVehicleModel(vehicle)-400]);
PlayerTextDrawSetString(playerid, BrzinometarTD[playerid][6], string2);
}
}
// pokusao sam i ime promjeniti i izbrisati neke tdove al et[/pawn]
Citat: 'xza poslato April 30, 2021, 17:56:53 POSLE PODNE
Slao je meni priv callback, unutar if (newstate == inveh) je ubacio funkciju gore tkd se nije mogla ni povuć kad izađe iz vozila još return ima pa ako bude fixao šta nek piše
Fixano, hvala xza, trebao sam staviti ono na pocetak