SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Arrays question (https://forum.sa-mp.com/showthread.php?t=424329)

PaulDinam 21/03/2013 05:31 PM

Arrays question
 
Can I use this as an 5 space array for int?
new trunkwep[5], trunkammo[5];

For example:

pawn Code:
VehicleInfo[PlayerInfo[playerid][pCarKey]][carTrunkWep][0] = trunkwep[0];
        VehicleInfo[PlayerInfo[playerid][pCarKey]][carTrunkAmmo][0] = trunkammo[0];

Glad2BeHere 21/03/2013 05:33 PM

Re: Arrays question
 
yep
0-4 =5

Jewell 21/03/2013 05:35 PM

Re: Arrays question
 
yes. you can. trunkammo[0], trunkammo[1], ect

Misiur 21/03/2013 05:37 PM

Re: Arrays question
 
Why not
pawn Code:
VehicleInfo[PlayerInfo[playerid][pCarKey]][carTrunkWep] = trunkwep;
VehicleInfo[PlayerInfo[playerid][pCarKey]][carTrunkAmmo] = trunkammo;


All times are GMT. The time now is 12:34 AM.

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