[Include] SetPlayerPositionWithVehicle(playerid, x, y, z);
#1

hi all, today I have made a simple include, with this function can set the player position when the player is in the car.
Код:
SetPlayerPositionWithVehicle(playerid, x, y, z);
this is the script:
Код:
#include <a_samp>

SetPlayerPosWithVehicle(playerid, Float:X, Float:Y, Float:Z)
{
	SetPlayerPosEx(playerid,X,Y,Z);
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
		LinkVehicleToInterior(GetPlayerVehicleID(playerid),0);
		PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
		SetVehicleZAngle(GetPlayerVehicleID(playerid),0.0);
	}
}

SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z)
{
	SetPlayerPos(playerid,X,Y,Z);
	SetPlayerInterior(playerid,0);
	SetPlayerWorldBounds(playerid, 99999.0, -99999.0, 99999.0, -99999.0);
}
DOWNLOAD:
http://solidfiles.com/d/6fd244e65c/
Reply
#2

what did I posted in the useful functions thread?
Reply
#3

Useful Snippets
Reply
#4

You should make it SetPlayerPosWithVehicle(playerid,Float: p_x,Float: p_y,Float: p_z,Float:veh_a);

What if you don't want the 0.0 facing angle with the car...?
Reply
#5

Are you sure this is working if the player is in a vehicle? Because if you set his position then he can't be the "Driver", so everything after setting his normal position won't work.
Reply
#6

Woow, very nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)