PDA

View Full Version : rent


MatriXgaMer
28/01/2014, 06:55 PM
Hey i need help with rent a car system :)

error:

C:\Users\matRixgameR\Desktop\Pawno\gamemodes\RedWo od.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

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

new RentAuto[1];

SerieWoordenaar
28/01/2014, 07:22 PM
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)

Konstantinos
28/01/2014, 07:23 PM
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.

MatriXgaMer
28/01/2014, 07:27 PM
Thanks :)