11.08.2018, 16:53
Hello.
I have a strange problem, namely the code I put below doesn't work.
CrashDetect detects that:
I am asking you for help.
I have a strange problem, namely the code I put below doesn't work.
Код:
new string[100], vehicleid[2], VehicleText[30];
vehicleid[0] = dini_Int(PlayerAccountPath(playerid), "PrivVeh1");
vehicleid[1] = dini_Int(PlayerAccountPath(playerid), "PrivVeh2");
PlayerData[PlayerData[playerid][SellID]][SellAmount] = strval(inputtext);
PlayerData[PlayerData[playerid][SellID]][SellID] = playerid;
if(PlayerData[playerid][VehicleSell] == 1)
{
strcat(VehicleText, VehicleNames[vehicleid[0] -400]);
PlayerData[PlayerData[playerid][SellID]][VehicleSell] = 1;
}
else
{
strcat(VehicleText, VehicleNames[vehicleid[1] -400]);
PlayerData[PlayerData[playerid][SellID]][VehicleSell] = 2;
}
Код:
[debug] Run time error 4: "Array index out of bounds" [18:42:59] [debug] Attempted to read/write array element at negative index -400 [18:42:59] [debug] AMX backtrace: [18:42:59] [debug] #0 000158f4 in public OnDialogResponse (0, 94, 1, -1, 2249876) from carriage.amx

