Jump Vehicle w/ Image
#8

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I don't see how any of the code posted will help you avoid hitting objects.

You would need to loop through all objects that are close to the player, and make sure none of them are at jumping height. If they are don't allow the jump. This would be difficult because most objects are different sizes.

In fact i think the code above could spawn you inside some objects. I'd rather bounce off an object than risk getting stuck in one.

pawn Код:
if(IsPlayerInAnyVehicle(playerid))
    {
        new VehicleID,Float:B;
        VehicleID = GetPlayerVehicleID(playerid);
        GetVehicleZAngle(VehicleID,B);
        SetVehicleZAngle(VehicleID,B);
        SetVehicleVelocity(VehicleID, 0.0, 0.0, 0.2);
        SetVehicleAngularVelocity(VehicleID,0,0,0);
    }
^^ I don't think that will work as expected, that will stop the vehicle from moving in every direction except z by 0.2. IMO car jumps should keep the car traveling. Also something pointless in the above code is getting the angle and setting it to the same value

Better version:

pawn Код:
new VehicleID = GetPlayerVehicleID(playerid);
if(VehicleID)
{
    new Float:fVelocity[3];
    GetVehicleVelocity(VehicleID, fVelocity[0], fVelocity[1], fVelocity[2]);
    SetVehicleVelocity(VehicleID, fVelocity[0], fVelocity[1], fVelocity[2]+0.2);
}
EDIT: Something else i just thought of; you should add anti-abuse for car jumping, if you spam the jump button it will appear as if your flying.
Thanks help me alot!! It's fine its freeroam stunts and everything
Reply


Messages In This Thread
Jump Vehicle w/ Image - by kbalor - 25.06.2012, 10:57
Re: Jump Vehicle w/ Image - by newbienoob - 25.06.2012, 11:14
Re: Jump Vehicle w/ Image - by kbalor - 25.06.2012, 11:25
Re: Jump Vehicle w/ Image - by newbienoob - 25.06.2012, 11:32
Re: Jump Vehicle w/ Image - by kbalor - 25.06.2012, 11:41
Re: Jump Vehicle w/ Image - by Grand_Micha - 25.06.2012, 12:40
Re: Jump Vehicle w/ Image - by iggy1 - 25.06.2012, 12:48
Re: Jump Vehicle w/ Image - by kbalor - 25.06.2012, 18:06

Forum Jump:


Users browsing this thread: 1 Guest(s)