BulgariaRoam Posted January 18, 2018 Share Posted January 18, 2018 function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) bindKey(p, "enter", "down", "suicide") end if ( getElementModel (p, localVehicle) == 411 ) then toggleControl (p, "handbrake", false) end end i try alot of possibility but none seems to work for me. anyone know how i can disable hanbreak if the vehicle is infernus? Link to comment
idarrr Posted January 18, 2018 Share Posted January 18, 2018 if ( getElementModel (p, localVehicle) == 411 ) then toggleControl (p, "handbrake", false) end -- 'p' is player, not element vehicle Try this: if ( getElementModel (getPedOccupiedVehicle(p), localVehicle) == 411 ) then toggleControl (getPedOccupiedVehicle(p), "handbrake", false) end Link to comment
BulgariaRoam Posted January 18, 2018 Author Share Posted January 18, 2018 bad argument @ 'getElementModel' [Expected element at argument 1, got nil] Link to comment
BulgariaRoam Posted January 18, 2018 Author Share Posted January 18, 2018 the script is serverside. Link to comment
Sawos Posted January 18, 2018 Share Posted January 18, 2018 Take a Look at this Please : https://wiki.multitheftauto.com/wiki/ToggleControl You might be using The ToggleControl function which has to be Client side. Link to comment
BulgariaRoam Posted January 18, 2018 Author Share Posted January 18, 2018 function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) toggleControl (p, "handbreak", false ) bindKey(p, "enter", "down", "suicide") end end if i toggle control to disable hanbreak it disable for all vehicle, if i want to disable only when vehicle infernus not working Link to comment
[MTA]Weed Posted January 18, 2018 Share Posted January 18, 2018 clearly wont work, try this: function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) bindKey(p, "enter", "down", "suicide") end for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then if ( getElementModel (getPedOccupiedVehicle(p), localVehicle) == 411 ) then toggleControl (p, "handbrake", false) end end end end 1 Link to comment
BulgariaRoam Posted January 18, 2018 Author Share Posted January 18, 2018 oh my god dude you are the boss! 2 minutes ago, [MTA]Weed said: clearly wont work, try this: function StuntCountDownFinish() for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then setElementFrozen(getPedOccupiedVehicle(p), false) setVehicleDamageProof(getPedOccupiedVehicle(p), false) end toggleAllControls(p, true) bindKey(p, "enter", "down", "suicide") end for i, p in ipairs(getAlivePlayersInArena(getElementID(source))) do if getPedOccupiedVehicle(p) then if ( getElementModel (getPedOccupiedVehicle(p), localVehicle) == 411 ) then toggleControl (p, "handbrake", false) end end end end oh my god dude, you are a boss! works!!!!! Link to comment
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