SA-MP Forums Archive
rent - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: rent (/showthread.php?tid=490948)



rent - MatriXgaMer - 28.01.2014

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];



Re: rent - SerieWoordenaar - 28.01.2014

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)


Re: rent - Konstantinos - 28.01.2014

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.


Re: rent - MatriXgaMer - 28.01.2014

Thanks