SA-MP Forums Archive
no need of /flip - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: no need of /flip (/showthread.php?tid=267163)



no need of /flip - Millionaire - 07.07.2011

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


Re: no need of /flip - HyperZ - 07.07.2011

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;
}



Re: no need of /flip - Wesley221 - 07.07.2011

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


Re: no need of /flip - Babul - 07.07.2011

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..


Re: no need of /flip - Millionaire - 07.07.2011

ok ty guys