Right mouse click FLIP the car
#1

Hello,

What is code of flip the car with right mouse button?

Thanks for help.
Reply
#2

EDIT:

Untested hope this works for you.

Add this below your defines,
pawn Код:
KEY_AIM*                            (128)
We added this because key is not defined in SA:MP includes. You must define this yourself.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_FIRE))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            new currentveh;
            new Float:angle;
            currentveh = GetPlayerVehicleID(playerid);
            GetVehicleZAngle(currentveh, angle);
            SetVehicleZAngle(currentveh, angle);
            SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been flipped.");
        }
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
EDIT:
pawn Код:
if (PRESSED(KEY_FIRE))
lol. Didin't working with

if (PRESSED(KEY_AIM*))
{
Reply
#4

Oh here is the updated one:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_AIM))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
            new currentveh;
            new Float:angle;
            currentveh = GetPlayerVehicleID(playerid);
            GetVehicleZAngle(currentveh, angle);
            SetVehicleZAngle(currentveh, angle);
            SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been flipped.");
        }
    }
    return 1;
}
And remove the * from
pawn Код:
KEY_AIM*                            (128)
Reply
#5

Didin't working. :/
Reply
#6

Quote:

Currently working on a RolePlay and a TDM server.
Soon gonna publish the TDM.

TIP For scripters: dont make GMs which are very common like stunt, RP, TDm or any other. Make A Unique one.

just sayin

Back on topic:

I'm not sure if KEY_AIM works in a car... Let me test the code and i'll get back to you in a moment
Reply
#7

AFAIK the aim key doesn't work in vehicles.
Reply
#8

Try any of these Keys:
Код:
DefineValueGametext-Key on FootGametext-Key in Vehicle
KEY_ACTION1~k~~PED_ANSWER_PHONE~~k~~VEHICLE_FIREWEAPON~-
KEY_CROUCH2~k~~PED_DUCK~~k~~VEHICLE_HORN~
KEY_FIRE4~k~~PED_FIREWEAPON~
~k~~PED_FIREWEAPON_ALT~~k~~VEHICLE_FIREWEAPON~
~k~~VEHICLE_FIREWEAPON_ALT~
KEY_SPRINT8~k~~PED_SPRINT~~k~~VEHICLE_ACCELERATE~
KEY_SECONDARY_ATTACK16~k~~VEHICLE_ENTER_EXIT~~k~~VEHICLE_FIREWEAPON_ALT~
KEY_JUMP32~k~~PED_JUMPING~~k~~VEHICLE_BRAKE~
KEY_LOOK_RIGHT64-~k~~VEHICLE_LOOKRIGHT~
KEY_HANDBRAKE128~k~~PED_LOCK_TARGET~~k~~VEHICLE_HANDBRAKE~
KEY_LOOK_LEFT256-~k~~VEHICLE_LOOKLEFT~
KEY_SUBMISSION512-~k~~TOGGLE_SUBMISSIONS~
KEY_LOOK_BEHIND512~k~~PED_LOOKBEHIND~~k~~VEHICLE_LOOKBEHIND~
KEY_ANALOG_UP2048-~k~~VEHICLE_TURRETUP~
KEY_ANALOG_DOWN4096-~k~~VEHICLE_TURRETDOWN~
KEY_ANALOG_LEFT8192~k~~VEHICLE_LOOKLEFT~~k~~VEHICLE_TURRETLEFT~
KEY_ANALOG_RIGHT16384~k~~VEHICLE_LOOKRIGHT~~k~~VEHICLE_TURRETRIGHT~[*] Key not defined in SA:MP includes. You must define this yourself or use KEY_HANDBRAKE.
[**] Support for this key was added in 0.3d. It will not be detectable in earlier versions.

Up/Down-Keys
DefineValueGametext-Key on FootGametext-Key in Vehicle
KEY_UP-128~k~~GO_FORWARD~~k~~VEHICLE_STEERUP~
KEY_DOWN128~k~~GO_BACK~~k~~VEHICLE_STEERDOWN~
Left/Right-Keys
DefineValueGametext-Key on FootGametext-Key in Vehicle
KEY_LEFT-128~k~~GO_LEFT~~k~~VEHICLE_STEERLEFT~
KEY_RIGHT128~k~~GO_RIGHT~~k~~VEHICLE_STEERRIGHT~
Link for that:

GetPlayerKeys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)