
Ronis
Members-
Posts
15 -
Joined
-
Last visited
Ronis's Achievements

Square (6/54)
0
Reputation
-
Hello, i have a question, what's is not correct in this? So basicly, on the old script was only one sound, now it's 4. Something is not correct in server side because, when i put old script with only one sound, it's works, but this not. Client-side function setSirenState() elseif 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 ) function updateSirens( name ) if (name == "lspd:siren" or name == "lspd:extrasiren") and isElementStreamedIn( source ) and getElementType( source ) == "vehicle" then local attached = getAttachedElements( source ) if attached then for key, value in ipairs( attached ) do if getElementType( value ) == "sound" and value ~= sounds[ source ] then destroyElement( value ) end end end if sounds[ source ] then destroyElement( sounds[ source ] ) sounds[ source ] = nil end if (getElementData( source, "lspd:siren" ) == 1 and getElementData( source, "lspd:extrasiren" ) == nil) then sounds[source] = playSound3D("siren.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.3) setSoundMaxDistance(sounds[source], 220) setSoundMinDistance(sounds[source], 30) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) elseif getElementData( source, "lspd:extrasiren" ) == 2 then sounds[source] = playSound3D("2.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.4) setSoundMaxDistance(sounds[source], 220) setSoundMinDistance(sounds[source], 30) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) elseif getElementData( source, "lspd:extrasiren" ) == 3 then sounds[source] = playSound3D("3.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.4) setSoundMaxDistance(sounds[source], 220) setSoundMinDistance(sounds[source], 30) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) elseif getElementData( source, "lspd:extrasiren" ) == 4 then sounds[source] = playSound3D("4.wav", 0, 0, 0, true) attachElements( sounds[source], source ) setSoundVolume(sounds[source], 0.4) setSoundMaxDistance(sounds[source], 220) setSoundMinDistance(sounds[source], 30) setElementDimension(sounds[source], getElementDimension(source)) setElementInterior(sounds[source], getElementInterior(source)) end end end addEventHandler("onClientElementDataChange", getRootElement(), updateSirens) server-side function setSirenState(state) if state == 1 then elseif 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 ) Client-side function bindKey2(res) bindKey(",", "both", toggleSirens2) bindKey(",", "up", removeExtra) end addEventHandler("onClientResourceStart", getResourceRootElement(), bindKey2) function toggleSirens2() local theVehicle = getPedOccupiedVehicle(getLocalPlayer()) if (theVehicle) then local occupants = getVehicleOccupants(theVehicle) if occupants[0]==getLocalPlayer() then triggerServerEvent("lspd:setSirenState", theVehicle, 2) end end end°
-
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
-
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 )
-
i have question, someone have ideas how i can put the Utility Trailer to Elegy? Vehicle Model ID: 611 Vehicle Name: Utility Trailer Category: Trailers Modifications: None
-
Thankyou very very much, it's working very good. And thanks Noki and nosfera
-
local pizza[source] = createObject ( 1271, 0, 0, 0 ) Here unexpected symbol near '['
-
Hello, need little help with destroy element, someone can help me what's wrong, why function removeboxfromhands not working function PutBoxOnHand() local pizza = createObject ( 1271, 0, 0, 0 ) exports.bone_attach:attachElementToBone(pizza,source,12,0.081,0.05,0.01,0,-70,0) end addEvent("PutBoxOnHand", true) addEventHandler("PutBoxOnHand", root, PutBoxOnHand) function removeBoxFromHands () if pizza[source] and isElement(pizza[source]) then destroyElement(tank[source]) pizza[source] = nil end end addEvent("removeBoxHands", true) addEventHandler("removeBoxHands", getRootElement(),removeBoxFromHands)
-
You are the best man, the best, it's working, thankyou very much
-
wow man it's working, but one problem, the box is not removed, it's on the ground
-
ERROR attempt to index local 'tank' (a nill value) Line 33 = tank[source] = createObject ( 1220, x, y, z + 5 ) --Create a tank
-
Hey, i want detach the box createObject ( 1220, x, y, z + 5 ) --Create a tank
-
Hello, need little help with this detach elements. function PutBoxOnHand(tank, x, y, z) local x, y, z = getElementPosition ( source ) --Get the players position local tank = createObject ( 1220, x, y, z + 5 ) --Create a tank attachElements ( tank, source, 0, 0, -1 ) --Attach the tank to the player. end addEvent("PutBoxOnHand", true) addEventHandler("PutBoxOnHand", getRootElement(),PutBoxOnHand) function removeBoxHands (thePlayer) local tank = getAttachedElements( thePlayer ) detachElements ( tank) end addEvent("removeBoxHands", true) addEventHandler("removeBoxHands", getRootElement(),removeBoxHands) RemoveBoxHands not working
-
one time i try with bone but not working, maybe someone can help me with this bone?
-
Hello, i have question, how i can put some items on hands for example Woden box?