Help please
#1

Код:
SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
{
	new Float:x,Float:y,Float:z;
	new Float:facing;
	new Float:distance;

    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, facing);

    if(IsPlayerInAnyVehicle(playerid))
    {
        new destveh;
        destveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(destveh);
    }
    new Float:size_x,Float:size_y,Float:size_z;
	GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);

	distance = size_x + 0.5;

  	x += (distance * floatsin(-facing, degrees));
    y += (distance * floatcos(-facing, degrees));

	facing += 90.0;
	if(facing > 360.0) facing -= 360.0;

	return spawnVeh = CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1); PutPlayerInVehicle(playerid, spawnVeh, 0);
}
How can I make it put the player in the vehicle it created
Reply
#2

PutPlayerInVehicle
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)