Posts: 116
Threads: 26
Joined: Sep 2011
Reputation:
0
Hello,
I want a script if you type /ec it will enter the nearest vehicle, is that possible?
I'm using ZCMD.
Thanks!
Posts: 116
Threads: 26
Joined: Sep 2011
Reputation:
0
Where can I find that kind of script?
Posts: 737
Threads: 338
Joined: Jan 2013
Код:
new iveh;
new Float:vehpos[ 3 ];
for(iveh = 1; iveh < MAX_VEHICLES; iveh++)
{
GetVehiclePos(iveh, vehpos[ 0 ], vehpos[ 1 ], vehpos[ 2 ] );
if( IsPlayerInRangeOfPoint(playerid, 8.0, vehpos[ 0 ], vehpos[ 1 ], vehpos[ 2 ] ) )
{
// you can do all what you want, here script find a vehicle, which is near you.
}
}
Posts: 737
Threads: 338
Joined: Jan 2013
Create command, and past this code, i think i give you very good code, and you just need paste it, to your create command..
Posts: 737
Threads: 338
Joined: Jan 2013
// you can do all what you want, here script find a vehicle, which is near you.
here you have to put code if you want put player in vehicle:
PutPlayerInVehicle( playerid, iveh, 0 );
Posts: 116
Threads: 26
Joined: Sep 2011
Reputation:
0
Can you fix it, if there is already a driver you will seat on passenger seat?
Posts: 737
Threads: 338
Joined: Jan 2013
I don't remember well, but you can check in what seat is player.. Just do cikle check all players, and check if that cikle player is in that car. Then check him seat, i think GetPlayerSeatID...