Crashing through windshield
#4

You're throwing the player to 0.0, 0.0, 0.0. Try this:

pawn Код:
public OnPlayerCrashVehicle(playerid, vehicleid, Float:damage)
{
    new Float:x, Float:y, Float:z, Float:angle;

    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z + 1.0);
    GetVehicleZAngle(vehicleid, angle);
    SetPlayerVelocity(playerid, x + (damage * floatsin(-angle, degrees), y + (damage * floatcos(-angle, degrees), 1.0);
    return 1;
}
That will throw the player in front of him. damage will be the distance that the player will be throwed. You can change it to a constant value if you like.

I don't tested it IG, but I've done some test about that a long time ago. So I think it will work fine
Reply


Messages In This Thread
Crashing through windshield - by GoldenLion - 05.11.2016, 16:06
Re: Crashing through windshield - by Abagail - 05.11.2016, 16:10
Re: Crashing through windshield - by GoldenLion - 05.11.2016, 16:24
Respuesta: Crashing through windshield - by Swedky - 05.11.2016, 17:31
Re: Respuesta: Crashing through windshield - by GoldenLion - 05.11.2016, 18:09

Forum Jump:


Users browsing this thread: 2 Guest(s)