Hotkey Help
#1

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
Reply
#2

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.
Reply
#3

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/Keys
Reply
#4

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
Reply
#5

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

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

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
Reply
#8

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)