Jump to content

Help!


Tonnzza

Recommended Posts

I am new in scripting. How i make it from those functions?

server.lua

players = getElementsByType("player") 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
   for index,player in ipairs(players) do 
   bindKey(player, "M","down", sirens) 
   end 
end) 
  
function sirens(player) 
local veh = getPedOccupiedVehicle(player) 
    if (veh) then 
      addVehicleSirens(veh,1,1) 
        if not getVehicleSirensOn (veh) then 
            outputChatBox("Sirens: ON", player, 0, 255, 0) 
            setVehicleSirensOn (veh, true) 
        else 
            outputChatBox("Sirens: OFF", player, 255, 0, 0) 
            setVehicleSirensOn (veh, false) 
            removeVehicleSirens(veh) 
        end 
    end 
end 

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