SA-MP Forums Archive
Hotkey Help - 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)
+--- Thread: Hotkey Help (/showthread.php?tid=512609)



Hotkey Help - Proximo - 11.05.2014

Hey there SA-MP Community,

I have been searching hotkey script for "FLIP" since a long time, I am not able to find any so I decided to make a thread here. I wouldn't want to waste your time but I would really appreciate if someone can make a filterscript where the key "Y" is defined for "vehicle flip" and can you also please attach right in this thread, so it can help people who have similar problems later too?

Thanks in advance.

Seeking your co-operation,
Proximo


Re: Hotkey Help - Parallex - 11.05.2014

It's just easy if you got a command already made for flipping a vehicle. If you got a command already for /flip, tell the command and also tell me what command processor you use. I'll make it for you here.


Re: Hotkey Help - Konstantinos - 11.05.2014

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/Keys


Re: Hotkey Help - Proximo - 12.05.2014

Quote:
Originally Posted by BenJackster
Посмотреть сообщение
It's just easy if you got a command already made for flipping a vehicle. If you got a command already for /flip, tell the command and also tell me what command processor you use. I'll make it for you here.
zCMD


Re: Hotkey Help - Scottas - 12.05.2014

pawn Код:
public OnPlayerKeyStateChange(playerid, newstate, oldstate)
{
    if(newkeys & KEY_YES)
        cmd_flip(playerid, "");
    return 1;
}
Try this one


Re: Hotkey Help - Proximo - 12.05.2014

I used this:

Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
    if ( IsPlayerInAnyVehicle( playerid ) )
    {
        if ( newkeys == KEY_YES )
        {
            new Float: zAng;
            GetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            SetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            GameTextForPlayer( playerid, "~r~Vehicle Flipped!", 3000, 3 );
        }
    }
    return 1;
}
And, it worked pretty well. Perhaps, thanks to those who tried to help anyways..


Re: Hotkey Help - BroZeus - 12.05.2014

it should be
pawn Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
    if ( IsPlayerInAnyVehicle( playerid ) )
    {
        if ( (newkeys & KEY_YES) !(oldkeys & KEY_YES) )
        {
            new Float: zAng;
            GetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            SetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            GameTextForPlayer( playerid, "~r~Vehicle Flipped!", 3000, 3 );
        }
    }
    return 1;
}
the code u sing will work but it will have bugs use the above one see the changes in "if" line
the bug is that if the y key is being pressed and during it has been presed and some other key is pressed then the vehicle will flip again read https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange carefully


Re: Hotkey Help - Proximo - 12.05.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
it should be
pawn Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys )
{
    if ( IsPlayerInAnyVehicle( playerid ) )
    {
        if ( (newkeys & KEY_YES) !(oldkeys & KEY_YES) )
        {
            new Float: zAng;
            GetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            SetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
            GameTextForPlayer( playerid, "~r~Vehicle Flipped!", 3000, 3 );
        }
    }
    return 1;
}
the code u sing will work but it will have bugs use the above one see the changes in "if" line
the bug is that if the y key is being pressed and during it has been presed and some other key is pressed then the vehicle will flip again read https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange carefully
I get error's using that!