Skripta koju koristim:Moj edit UP-a
Detaljno objasnjenje problema:
E ovako izlaze mi erorri posto ja sam uradio novi brzinomer a kad sam ubacio stvorio mi erore ove dole
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(26640) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(26640) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(26980) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44272) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44273) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44274) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44275) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44276) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44277) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44278) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44279) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44280) : error 032: array index out of bounds (variable "BRZINOMER")
C:\Documents and Settings\Admin\My Documents\Downloads\New Folder\gamemodes\SPuerto.pwn(44281) : error 032: array index out of bounds (variable "BRZINOMER")
Evo vam dole kod celog tog brzinomera pa vi to prepravite
Deo skripte:
[pawn]
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new vozilo = GetPlayerVehicleID(playerid);
if(!VoziloJeBicikla(GetVehicleModel(GetPlayerVehicleID(playerid))))
{
new string[128];
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[0][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[0][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[1][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[1][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[2][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[2][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[3][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[3][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[4][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[4][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[5][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[5][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[7][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[7][playerid]);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[8][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawShow(playerid, BRZINOMER[8][playerid]), format(string, sizeof(string), "~w~%d L", Fuel[GetPlayerVehicleID(playerid)]), PlayerTextDrawSetString(playerid, BRZINOMER[8][playerid], string);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[9][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[9][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), "~w~%d", GetSpeed(playerid)), PlayerTextDrawSetString(playerid, BRZINOMER[10][playerid], string);
if(oldstate-1 && newstate) PlayerTextDrawHide(playerid, BRZINOMER[11][playerid]); else if(newstate == PLAYER_STATE_DRIVER) PlayerTextDrawHide(playerid, BRZINOMER[11][playerid]);
else if(newstate == PLAYER_STATE_DRIVER)
{
//PlayerTextDrawHide(playerid, BRZINOMER[4][playerid]);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 0 || engine == -1)
{
//format(string, sizeof(string), "~r~o");
//PlayerTextDrawSetString(playerid,BRZINOMER[4][playerid], string);
}
else if(engine == 1)
{
// format(string, sizeof(string), "~g~o");
//PlayerTextDrawSetString(playerid,BRZINOMER[4][playerid], string);
}
}
}
[/pawn]
I dole sam dodao za sliku mozda sam tu zeznuo stvar
[pawn] if(newstate == PLAYER_STATE_DRIVER)
{
PlayerTextDrawSetPreviewModel(playerid, BRZINOMER[6], GetVehicleModel(vozilo));
//PlayerTextDrawSetPreviewModel(playerid, SlikaGorivo);
//PlayerTextDrawSetPreviewModel(playerid, SlikaBrzina);
PlayerTextDrawShow(playerid, BRZINOMER[6][playerid]);
//PlayerTextDrawShow(playerid, SlikaGorivo);
//PlayerTextDrawShow(playerid, SlikaBrzina);
}
else
{
PlayerTextDrawHide(playerid, BRZINOMER[6][playerid]);
//PlayerTextDrawHide(playerid, SlikaGorivo);
//PlayerTextDrawHide(playerid, SlikaBrzina);
}
return 1;
}
[/pawn]
Slika nesto://
Na vrh skripte postavi new BRZINOMER[MAX_PLAYERS];
Citat: [BU] Milos_Jovanovic poslato Mart 13, 2016, 19:22:41 POSLE PODNE
Na vrh skripte postavi new BRZINOMER[MAX_PLAYERS];
Ovako: BRZINOMER[ MAX_PLAYERS ][ broj TDova ];
Da tako ja se izvinjavam moja greska. :)