Sami_~> Posted February 12, 2018 Share Posted February 12, 2018 hello how can i stop driveby only for localplayer when the player select the checkbox. i try it but not working : if ( guiCheckBoxGetSelected(GUIEditor.checkbox[1])) then setPedDoingGangDriveby ( getLocalPlayer (), false ) Link to comment
Moderators IIYAMA Posted February 12, 2018 Moderators Share Posted February 12, 2018 (edited) Only ADD, with the code you already used. This code will replace the original setPedDoingGangDriveby function clientside and use it serverside instead. It will fix your de-synchronization. Remember, you still need to use setPedDoingGangDriveby in your original code. clientside function setPedDoingGangDriveby (ped, state ) triggerServerEvent("setPedDoingGangDriveby", resourceRoot, ped, state ) end serverside addEvent("setPedDoingGangDriveby", true) addEventHandler("setPedDoingGangDriveby", resourceRoot, function (ped, state ) if isElement(ped) then setPedDoingGangDriveby(ped, state ) end end, false) Edited February 12, 2018 by IIYAMA 1 Link to comment
Sami_~> Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) Thank you @IIYAMA Edited February 13, 2018 by Sami_~> Link to comment
Sami_~> Posted February 13, 2018 Author Share Posted February 13, 2018 15 hours ago, IIYAMA said: Only ADD, with the code you already used. Can u fix this : i want to disable rino fire local blockedVehicles = {[432] = true} function blockEnterOnBlockedVehicles(player, seat, jacked) local model = getElementModel(source) if isElement(source) and getElementType(source) == "vehicle" and (model and blockedVehicles[model]) then if isElement(player) and getElementType(player) == "player" and seat == 0 then toggleControl ( "vehicle_fire", false ) (true, "blockedvehicle") end end end addEventHandler("onVehicleStartEnter", getRootElement(), blockEnterOnBlockedVehicles) Link to comment
Moderators IIYAMA Posted February 13, 2018 Moderators Share Posted February 13, 2018 Use this event instead: https://wiki.multitheftauto.com/wiki/OnVehicleEnter Also: (not sure what this was about) toggleControl ( "vehicle_fire", false ) (true, "blockedvehicle") Link to comment
Moderators IIYAMA Posted February 13, 2018 Moderators Share Posted February 13, 2018 toggleControl(player, "vehicle_fire",false) * as it is server-side. 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