Jump to content

stop driveby


Sami_~>

Recommended Posts

Posted

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 )
 
   

 

 


 


  • Moderators
Posted (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 by IIYAMA
  • Thanks 1

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted
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)

 

 


 


  • Moderators
Posted

Use this event instead:

https://wiki.multitheftauto.com/wiki/OnVehicleEnter

 

Also: (not sure what this was about)

toggleControl ( "vehicle_fire", false ) (true, "blockedvehicle")

 

 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
toggleControl(player, "vehicle_fire",false)

* as it is server-side.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...