Jump to content

What is not correct? :D


Ronis

Recommended Posts

Posted

Hello, so i have question, maybe i am wrong, but i thinking about this.

  
IN CLIENT-SIDE 
triggerServerEvent("lspd:setSirenState", theVehicle, 1) 

For example if there is the 1 it's not working , how i can put the one over here?

  
IN SERVER-SIDE 
function setSirenState() 
    if exports.global:hasItem(source, 85) then -- sirens 
        local curState = getElementData(source, "lspd:siren") 
        exports.anticheat:changeProtectedElementDataEx(source, "lspd:siren", not curState) 
        setVehicleSirensOn ( source , not curState ) 
    end 
end 
addEvent( "lspd:setSirenState", true ) 
addEventHandler( "lspd:setSirenState", getRootElement(), setSirenState ) 

Posted

Server side

function setSirenState(state) 
        if state == 1 then 
               --what to do if its 1 
        else 
              --what to do if its not 1 
         end 
end 

You gone learn today.

I work my ass off, but I still can't pay tho.

Posted

NOP not working,

c-side

 function toggleSirens() 
    local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) 
    if (theVehicle) then 
        local occupants = getVehicleOccupants(theVehicle) 
        if occupants[0]==getLocalPlayer() then 
            triggerServerEvent("lspd:setSirenState", theVehicle, 1) 
        end 
    end 
end 
  

Posted
if (getPedOccupiedVehicleSeat(getLocalPlayer()) == 0) then 

instead of

local occupants = getVehicleOccupants(theVehicle) 
if occupants[0]==getLocalPlayer() then 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

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