Jump to content

Help if specific team enters area led shoots the


VenomOG

Recommended Posts

  1. server side
  2. addCommandHandler("dude",
  3. function(thePlayer)
  4.     local gunner = createPed(0, 0, 0, 0)
  5.     giveWeapon(gunner, 31, 999999999, true)
  6.     local posX, posY, posZ = getElementPosition(thePlayer)
  7.     setElementPosition(gunner, posX + 2, posY, posZ)
  8.     triggerClientEvent("onRequestStartBlabla", thePlayer, gunner)
  9.     outputChatBox("gunner!")
  10. end)
  11.  
  12. --client side
  13. local theDude = nil
  14.  
  15. function shooter()
  16.     if(theDude == nil)then return end
  17.     local vehicle = getPedOccupiedVehicle(getLocalPlayer())
  18.     if(vehicle == false)then return end
  19.     local isShooting = getControlState("vehicle_secondary_fire")
  20.     if(isShooting)then
  21.         setPedControlState(theDude, "fire", true)
  22.         outputChatBox("is shooting!")
  23.     else
  24.         setPedControlState(theDude, "fire", false)
  25.     end
  26. end
  27.  
  28.  
  29. addEvent("onRequestStartBlabla", true)
  30. addEventHandler("onRequestStartBlabla", getRootElement(),
  31. function(gunner)
  32.     theDude = gunner
  33.     addEventHandler("onClientRender", getRootElement(), shooter)
  34. end)
  35.  
  36.  
Link to comment

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...