Vehicle crash like IV
#1

Hello i just wondering how to make player fly out of front window like it is in GTA IV. I have seen it some servers but i have no clue how to make it.
Reply
#2

There's a way to make it kinda look like. Do speed checks ─ whenever the speed drops sharply make the player move some units (SetPlayerVelocity) to the front and use some animation to make it look more realistic.
Reply
#3

Thank you RyDeR but can you suggest good animation?
Reply
#4

I'd suggest the (sky) diving animation. You might want to take a look here to find it.
Reply
#5

I try it but something wrong...
pawn Код:
new Float:CarHealth[MAX_PLAYERS];
Funktsioon Damage()
{
    foreach(Player,playerid) // foreach include in use :)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:TempCarHealth;
            new Veh = GetPlayerVehicleID(playerid);
            GetVehicleHealth(Veh, TempCarHealth);
            new Float:Difference = floatsub(CarHealth[playerid], TempCarHealth);
            if((floatcmp(CarHealth[playerid], TempCarHealth) == 1) && (floatcmp(Difference,1.0) == 1))
            {
                new Float:X,Float:Y,Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                new Float:Velocity[3];
                GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
                SetPlayerPos(playerid,x+Velocity[0],y+Velocity[1],z+Velocity[2]);
                Difference = floatdiv(Difference, 10.0);
                new Float:OldHealth;
                GetPlayerHealth(playerid, OldHealth);
                SendClientMessage(playerid,-1,"You just crash");
                SetPlayerHealth(playerid, floatsub(OldHealth, Difference));
            }
            CarHealth[playerid] = TempCarHealth;
        }
        else
        {
            CarHealth[playerid] = 0.0; //To aviod that a player dies when he enters a vehicle
        }
    }
    return 1;
}
Player not go to front of vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)