Hey,
ich weiß nicht wieso crashdetect was raus spuckt aber :
Ich vermute dass es daran liegt dass ich die Vehicle IDs ( minimum bis zum maximum ) etwas erhöht habe da ich einen Wasserpanzer erstellen wollte ( ist id 601 ) bin mir aber nicht sicher
Hier der Abschnitt den ich verändert habe um Fraktionsfahrzeuge zu erstellen :
Code
if(mdid>601 || mdid<400)return SendClientMessage(playerid,GRAU,"Fehler: Inakzeptable Modell ID.");
Von 599 auf 601 erhöht ( Maximum )
Code
[14:37:42] [debug] Run time error 4: "Array index out of bounds"
[14:37:42] [debug] Attempted to read/write array element at negative index -400
[14:37:42] [debug] AMX backtrace:
[14:37:42] [debug] #0 00045254 in public TachoUpdate (playerid=1) at C:\Users\Drai\Desktop\Server\gamemodes\gamemode.pwn:5255
[14:45:22] sscanf warning: Strings without a length are deprecated, please add a destination size.
[14:45:24] sscanf warning: Strings without a length are deprecated, please add a destination size.
[14:45:29] sscanf warning: Strings without a length are deprecated, please add a destination size.
[14:51:04] [debug] Run time error 4: "Array index out of bounds"
[14:51:04] [debug] Attempted to read/write array element at negative index -400
[14:51:04] [debug] AMX backtrace:
[14:51:04] [debug] #0 00045254 in public TachoUpdate (playerid=1) at C:\Users\Drai\Desktop\Server\gamemodes\gamemode.pwn:5255
Alles anzeigen
Code
forward TachoUpdate(playerid);
public TachoUpdate(playerid)
{
if(!PlayerOnline(playerid))return 1;
if(!IsPlayerInAnyVehicle(playerid))return 1;//======================== CHECK ========================//
new vid=GetPlayerVehicleID(playerid);
new str[300];
new Float:vhealth;
if(IsPlayerInAnyVehicle(playerid))GetVehicleHealth(vid,vhealth);
new fhealth;
fhealth = floatround(floatround(vhealth - 250) / 7.5);
if(!IsPlayerInAnyVehicle(playerid))return 1;
format(str,sizeof(str),"~p~Tank:~w~ %d/%d~b~L~w~~n~~n~",vTank[vid],CarTanks[GetVehicleModel(vid)-400]); BETROFFENE ZEILE <-------------------------------------------
if(vTank[vid]==5000)format(str,sizeof(str),"~p~Tank:~w~ -~n~~n~",vTank[vid]);
format(str,sizeof(str),"%s~p~KM-Stand:~w~ -~n~~n~",str);
format(str,sizeof(str),"%s~p~%s:~w~ %d%%%~n~~n~",str,CarName[GetVehicleModel(vid)-400], fhealth);
format(str,sizeof(str),"%s%d km/h",str,GetPlayerSpeed(playerid));
PlayerTextDrawSetString(playerid, TachoTd[playerid][2], str);
//spv(playerid,"TachoTimerID",SetTimerEx("TachoUpdate", 500, true, "i", playerid));
return 1;
}
Alles anzeigen