enter vehicle
#1

Hello,

I want a script if you type /ec it will enter the nearest vehicle, is that possible?

I'm using ZCMD.

Thanks!
Reply
#2

Where can I find that kind of script?
Reply
#3

Код:
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.
}
}
Reply
#4

And in a zmcD? :P
Reply
#5

Create command, and past this code, i think i give you very good code, and you just need paste it, to your create command..
Reply
#6

0 errors and 0 warnings, but it doesn't work.

Код:
CMD:ev(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");

	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.
	}
	}
	return 1;
}
Reply
#7

// 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 );
Reply
#8

Can you fix it, if there is already a driver you will seat on passenger seat?
Reply
#9

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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)