SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 28/01/2014, 06:55 PM   #1
MatriXgaMer
Big Clucker
 
MatriXgaMer's Avatar
 
Join Date: Dec 2013
Location: Srbija
Posts: 169
Reputation: 5
Default rent

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];
MatriXgaMer is offline   Reply With Quote
Old 28/01/2014, 07:22 PM   #2
SerieWoordenaar
Little Clucker
 
SerieWoordenaar's Avatar
 
Join Date: Jan 2014
Posts: 11
Reputation: 123
Default Re: rent

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)
SerieWoordenaar is offline   Reply With Quote
Old 28/01/2014, 07:23 PM   #3
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: rent

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.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 28/01/2014, 07:27 PM   #4
MatriXgaMer
Big Clucker
 
MatriXgaMer's Avatar
 
Join Date: Dec 2013
Location: Srbija
Posts: 169
Reputation: 5
Default Re: rent

Thanks
MatriXgaMer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP WITH RENT Gangasta300 Help Archive 1 17/04/2011 08:23 AM
Rent Car Lonka Help Archive 1 05/09/2009 07:30 PM


All times are GMT. The time now is 06:20 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.