no need of /flip
#1

I want /flip but it should not be a command.When i press 2 , then it should be fliped.Can anyone give me code?
Reply
#2

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SUBMISSION && IsPlayerInAnyVehicle(playerid))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:PX, Float:PY, Float:PZ, Float:PA;
            GetPlayerPos(playerid, PX, PY, PZ);
            GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
            SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
            PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
            SendClientMessage(playerid, -1,"Vehicle flip!!");
        }
        else
        {
            SendClientMessage(playerid, -1,"Error: you're not in Vehicle ");
        }
    }
    return 1;
}
Reply
#3

pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SUBMISSION))
    {
        //flip things
        return 1;
    }
    return 1;  
}
This should work
Edit: Late
Reply
#4

oh.. regardless that this topic is solved, i got an idea:
theres the GetVehicleRotationQuat().. if anyone ever solves the 3 quaternion states when a vehicle is flipped, (and its speed is very low like 0-1 Km/h), then an automatic flip could be done. or, as you want, to enable a keypress to flip it..
Reply
#5

ok ty guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)