21.12.2017, 00:56
after i made few faction cars it shows me in "server log" BUT ONLY IF I+M TRYING TO GET INTO FACTION CARS
Код:
[debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 11 past array upper bound 10 [debug] AMX backtrace: [debug] #0 00096130 in public OnPlayerEnterVehicle (0, 36, 0) from kucni.amx [debug] Run time error 4: "Array index out of bounds" [debug] Accessing element at index 11 past array upper bound 10 [debug] AMX backtrace: [debug] #0 00096130 in public OnPlayerEnterVehicle (0, 44, 0) from kucni.amx
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { for(new i = 0; i < 12; i++) //Loop. It counts to 11 { //Open Bracket if(vehicleid == GSFcar[i]) //If the vehicleid is an LSPD vehicle { //Open Bracket if(pData[playerid][Faction] != 1) //If the player is not in faction 1 (LSPD, in this case) { //Open Bracket ClearAnimations(playerid); //Clears their animation, preventing them from entering the vehicle. SendClientMessage(playerid, -1, "You don`t have the keys for this car."); //Sends a message to the player that he cannot enter it. } //Closed Bracket } //Closed Bracket } //Closed Bracket