Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this isn't the exact source code as I don't have it anymore, since I've been slowly updating the code
- //global variables
- DWORD timePressed = 0;
- DWORD amountOfTimePressed = 0;
- Ped me = NULL;
- Vehicle veh = NULL;
- //global functions
- bool isKeyPressed(int nVirtKey)
- {
- //return (GetKeyState(nVirtKey) & 0x8000) != 0;
- return (GetAsyncKeyState(nVirtKey) & 0x8000) != 0;
- }
- //inside main function
- while (true)
- {
- if (isKeyPressed(key)) //check if jump key pressed
- {
- if (timePressed == 0) timePressed = GetTickCount(); //set time the key was pressed
- }
- else if (timePressed != 0) //check if key was pressed
- {
- amountOfTimePressed = GetTickCount() - timePressed; //get the amount of time the key was pressed
- if (amountOfTimePressed > maxTimeHoldButton) amountOfTimePressed = maxTimeHoldButton; //if above max then set it to the max
- me = PLAYER::PLAYER_PED_ID(); //get the player ped
- if (ENTITY::DOES_ENTITY_EXIST(me) && ENTITY::GET_ENTITY_HEALTH(me) > 0 && PED::IS_PED_IN_ANY_VEHICLE(me, 1)) //check if alive, and is in vehicle
- {
- veh = PED::GET_VEHICLE_PED_IS_USING(me); //get vehicle
- if (ENTITY::DOES_ENTITY_EXIST(veh) && VEHICLE::IS_VEHICLE_ON_ALL_WHEELS(veh)) //check if vehicle exists (again) and check if is on all wheels
- {
- ENTITY::APPLY_FORCE_TO_ENTITY(veh, 0, 0, 0, amountOfTimePressed * multiplier, 0, 0, 0, 0, 1, 1, 1, 0, 1); //apply force
- }
- }
- timePressed = 0; //reset time pressed
- }
- WAIT(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement