Mr Wet Posted June 2, 2015 Share Posted June 2, 2015 hi is anyone able to help me out with this?and also i have Vehicle Boost Working But i want it to toggle on and off so that when i turn it on i press Left CTRL or a different button and it will boost the car? here is how im doing boost at the moment BOOL boost = TRUE; if (LEFT_CTRL_PRESSED) { boost = TRUE; SET_VEHICLE_FORWARD_SPEED(GET_VEHICLE_PED_IS_USING(PLAYER_PED_ID()), 100.0f); PrintStringBottomCentre("Vehicle Boost"); } but that just give the car a one time boost when i click the mod in the menu. Link to comment Share on other sites More sharing options...
Tustin Posted June 3, 2015 Share Posted June 3, 2015 (edited) hi is anyone able to help me out with this? and also i have Vehicle Boost Working But i want it to toggle on and off so that when i turn it on i press Left CTRL or a different button and it will boost the car? here is how im doing boost at the moment BOOL boost = TRUE; if (LEFT_CTRL_PRESSED) { boost = TRUE; SET_VEHICLE_FORWARD_SPEED(GET_VEHICLE_PED_IS_USING(PLAYER_PED_ID()), 100.0f); PrintStringBottomCentre("Vehicle Boost"); } but that just give the car a one time boost when i click the mod in the menu. Here's a vehicle spawning function I did a while back: void SpawnVehicle(Hash hash) { if (IS_MODEL_IN_CDIMAGE(hash)) { REQUEST_MODEL(hash); while (!HAS_MODEL_LOADED(hash)) WAIT(0); Vector3 pos = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER_PED_ID(), 3.0, 2.0, 0); CREATE_VEHICLE(hash, pos.x, pos.y, pos.z, GET_ENTITY_HEADING(PLAYER_PED_ID()), 0, 1); SET_MODEL_AS_NO_LONGER_NEEDED(hash); PrintMessage("Spawned vehicle"); } else PrintMessage("Vehicle doesn't exist"); } This spawns a vehicle a bit in front of you. For the boosting bit, make a bool (like you have) that specifies whether the boost is on/off. Have it toggle whenever you click the option in the menu like so: bool boost;//inside your menu selecting function for the boost optionboost = !boost; Then, have some check in a loop like this: if (LEFT_CTRL_PRESSED && boost) SET_VEHICLE_FORWARD_SPEED(GET_VEHICLE_PED_IS_USING(PLAYER_PED_ID()), 100.0f); Doing that makes sure the person has the boost option enabled and if they press left control it will boost them. Hope this helps! Edited June 3, 2015 by Tustin Link to comment Share on other sites More sharing options...
Mr Wet Posted June 3, 2015 Author Share Posted June 3, 2015 okay dude thank you very much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now