Posts: 72
Threads: 17
Joined: Jun 2014
Reputation:
0
that possible to get players in vehicle without loop if someone know how that very help me.
Posts: 498
Threads: 24
Joined: Apr 2013
no way without looping , you should loop and use IsPlayerInVehicle
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
I suppose you could use foreach to create an iterator for each vehicle. But that array would be huge since you need to allocate 2000 vehicles, multiplied by the number of available seats. Then when the player enters the vehicle you push their playerid onto the array. Whenever you need to get the players in the car you use a foreach statement. This'd loop through about 4 values or so. I believe a bus can seat 8 players, though.
Posts: 183
Threads: 22
Joined: May 2013
Reputation:
0
IsPlayerInAnyVehicle, do you mean that ?
Posts: 558
Threads: 59
Joined: Jun 2012
Reputation:
0
He cant do it without a loop, it doesnt really matter if it is IsPlayerInAnyVehicle, or IsPlayerInVehicle.
Try imagine this:
Max 2000 Vehicles on SA-MP.
621-400 = 221 cars on SA-MP including all kind of transports:
Some of them have 1,2,4 seats.
And he have to verify for each ....
Is a Math calculation so huge that I cant type it here (but I have it in my mind.)