30.01.2015, 22:31
I get like alot of errors and i dont know why, i think the problem is somewhere in onplayerupdate..
This is what the problem is(i guess):
Код:
[00:05:46] [debug] Run time error 4: "Array index out of bounds" [00:05:46] [debug] Accessing element at index 400 past array upper bound 211 [00:05:46] [debug] AMX backtrace: [00:05:46] [debug] #0 000e3374 in public cmd_kupivozilo (0x00000000, 0x0022868c) from rpfa.amx [00:05:46] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [00:05:46] [debug] #2 00006368 in public OnPlayerCommandText (0x00000000, 0x0022865c) from rpfa.amx [00:05:50] [debug] Run time error 4: "Array index out of bounds" [00:05:50] [debug] Accessing element at index 409 past array upper bound 211 [00:05:50] [debug] AMX backtrace: [00:05:50] [debug] #0 00080690 in public RL_OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:50] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [00:05:50] [debug] #2 00009740 in public OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:51] [debug] Run time error 4: "Array index out of bounds" [00:05:51] [debug] Accessing element at index 411 past array upper bound 211 [00:05:51] [debug] AMX backtrace: [00:05:51] [debug] #0 00080690 in public RL_OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:51] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [00:05:51] [debug] #2 00009740 in public OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:53] [debug] Run time error 4: "Array index out of bounds" [00:05:53] [debug] Accessing element at index 412 past array upper bound 211 [00:05:53] [debug] AMX backtrace: [00:05:53] [debug] #0 00080690 in public RL_OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:53] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [00:05:53] [debug] #2 00009740 in public OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:55] [debug] Run time error 4: "Array index out of bounds" [00:05:55] [debug] Accessing element at index 413 past array upper bound 211 [00:05:55] [debug] AMX backtrace: [00:05:55] [debug] #0 00080690 in public RL_OnPlayerUpdate (0x00000000) from rpfa.amx [00:05:55] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe [00:05:55] [debug] #2 00009740 in public OnPlayerUpdate (0x00000000) from rpfa.amx
This is what the problem is(i guess):
pawn Код:
if(LiderKupuje[playerid] == true)
{
new Keys, ud, lr, str[128], str2[128], ime[25];
GetPlayerKeys(playerid, Keys, ud, lr); GetPlayerName(playerid, ime, sizeof(ime));
if(lr > 0)
{
Autosalon[playerid]++;
if(Autosalon[playerid] >= sizeof(OrgVozila)) Autosalon[playerid] = 0;
DestroyVehicle(IzlozbenoVozilo[playerid]);
IzlozbenoVozilo[playerid] = CreateVehicle(OrgVozila[Autosalon[playerid]][0], 2148.2092,-1166.2465,23.7537,271.1449, 1, 1, -1);
format(str, sizeof(str), "Vozilo: %s", ImenaVozila[OrgVozila[Autosalon[playerid]][0]]);
TextDrawSetString(LiderBuyingVeh0[playerid], str);
format(str2, sizeof(str2), "Cena: %d", ImenaVozila[OrgVozila[Autosalon[playerid]][1]]);
TextDrawSetString(LiderBuyingVeh1[playerid], str2);
}
else if(lr < 0)
{
Autosalon[playerid]--;
if(Autosalon[playerid] < 0) Autosalon[playerid] = sizeof(OrgVozila)-1;
DestroyVehicle(IzlozbenoVozilo[playerid]);
IzlozbenoVozilo[playerid] = CreateVehicle(OrgVozila[Autosalon[playerid]][0], 2148.2092,-1166.2465,23.7537,271.1449, 1, 1, -1);
format(str, sizeof(str), "Vozilo: %s", ImenaVozila[OrgVozila[Autosalon[playerid]][0]]);
TextDrawSetString(LiderBuyingVeh0[playerid], str);
format(str2, sizeof(str2), "Cena: %d", ImenaVozila[OrgVozila[Autosalon[playerid]][1]]);
TextDrawSetString(LiderBuyingVeh1[playerid], str2);
}
if (Keys & KEY_HANDBRAKE || Keys & KEY_JUMP )
{
DestroyVehicle(IzlozbenoVozilo[playerid]);
SCM(playerid, WHITE, "Odustali ste od kupovine vozila...");
TogglePlayerControllable(playerid, 1);
LiderKupuje[playerid] = false;
SetCameraBehindPlayer(playerid);
TextDrawHideForPlayer(playerid, LiderBuyingVeh0[playerid]);
TextDrawHideForPlayer(playerid, LiderBuyingVeh1[playerid]);
}
}