Need help Rep+1
#1

How I can make if some one not close to the vehicles so he cant enter the vehicle
As Passenger and Even As Driver if he is not close to the vehicle Door..?
Reply
#2

I don't understand what do you mean...
Reply
#3

Like You see People Teleport Vehicles which are near to them and they are getting inside that vehicle as Drive..
So I want if some budy try to teleport vehicle he unable to teleport it.
I want he is far from the vehicle he cant teleport that that. any budy who are close to vehicle
only he can sit inside it as driver or as passenger.
Reply
#4

Get the coordinates of the vehicle, and check if the player is in a certain range with IsPlayerInRangeOfPoint, if he's too far away, then use GetPlayerPos, and use SetPlayerPos to his own position, which will make him stop.

EDIT: Just saw your new post, there's an include or something against that, i can't find it again though.
Reply
#5

You mean when players try to enter the vehicle while the vehicle moving far away, they enter the vehicle, is this what do you mean?
Reply
#6

Код:
	
        new Float:vehx, Float:vehy, Float:vehz;
 	GetVehiclePos(GetPlayerVehicleID(playerid), vehx, vehy, vehz);
	new Float: Distance = GetPlayerDistanceFromPoint(playerid, vehx, vehy, vehz);//if player is not close to vehicle x , y ,z..
	if(Distance>15.0)//it will check the distance here.. if distance is larger then he removed from vehicle !
	{
      RemovePlayerFromVehicle(playerid);
      new Float:slx, Float:sly, Float:slz;
      GetPlayerPos(playerid, slx, sly, slz);
      SetPlayerPos(playerid, slx, sly, slz);
	}
	

What should i do now
You mean when players try to enter the vehicle while the vehicle moving far away, they enter the vehicle, is this what do you mean?

Listen my mean is simple if player is not close to any vehicle he cant enter them..
Reply
#7

So what's the problem in that script?
Reply
#8

where should I use these codes Under OnPlayerEnterVehicle?
Reply
#9

Yes, use it under OnPlayerEnterVehicle.
Reply
#10

Is This Code Stop The Car Teleporting thing? which I maked?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)