Code doesn't work.
#1

Hello.

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;
}
CrashDetect detects that:

Код:
[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
I am asking you for help.
Reply


Messages In This Thread
Code doesn't work. - by Michatex - 11.08.2018, 16:53
Re: Code doesn't work. - by NaS - 11.08.2018, 17:06
Re: Code doesn't work. - by NeXTGoD - 11.08.2018, 17:15
Re: Code doesn't work. - by Michatex - 11.08.2018, 17:43

Forum Jump:


Users browsing this thread: 1 Guest(s)