How to get offset from vehicle?
#3

You can use this function from vspawner:

PHP код:
SpawnVehicle_InfrontOfPlayer(playeridvehiclemodelcolor1color2)
{
    new 
Float:x,Float:y,Float:z;
    new 
Float:facing;
    new 
Float:distance;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playeridfacing);
    new 
Float:size_x,Float:size_y,Float:size_z;
    
GetVehicleModelInfo(vehiclemodelVEHICLE_MODEL_INFO_SIZEsize_xsize_ysize_z);
    
    
distance size_x 0.5;
      
+= (distance floatsin(-facingdegrees));
    
+= (distance floatcos(-facingdegrees));
    
facing += 90.0;
    if(
facing 360.0facing -= 360.0;
    return 
CreateVehicle(vehiclemodelxy+ (size_z 0.25), facingcolor1color2, -1);

example:

PHP код:
CMD:v(playeridparams[])
{
    
SpawnVehicle_InfrontOfPlayer(playeridstrval(params), -1, -1);
    return 
1;

Reply


Messages In This Thread
How to get offset from vehicle? - by R3SpaWn0 - 03.08.2018, 03:52
Re: How to get offset from vehicle? - by GRiMMREAPER - 03.08.2018, 08:19
Re: How to get offset from vehicle? - by Lokii - 03.08.2018, 10:53
Re: How to get offset from vehicle? - by R3SpaWn0 - 03.08.2018, 12:31

Forum Jump:


Users browsing this thread: 1 Guest(s)