#1

Hey i need help with rent a car system

error:
pawn Code:
C:\Users\matRixgameR\Desktop\Pawno\gamemodes\RedWood.pwn(16) : error 032: array index out of bounds (variable "RentAuto")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Line 16
pawn Code:
public OnGameModeInit()
{
    RentAuto[1] = AddStaticVehicle(550,1560.7578,-2260.6877,13.3635,89.9114,2,2); //THis one
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}
my new for RentAuto[1] if needed
pawn Code:
new RentAuto[1];
Reply
#2

PAWN array indexes are zero-based so 1 is the second item, you need to use [0], that's the first one (your array only has a size of one)
Reply
#3

If the size of the array is 1, the valid index is 0. However, there's not any reason to use an array for it unless you use more than 1 vehicles.
Reply
#4

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)