Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/11/22 in all areas

  1. -- Client local theButton = guiCreateButton(100, 200, 80, 40, "Toggle Engine On/Off", false) function handleButton (button,state) if ( button == "left" and state == "up" ) then if ( source == theButton ) then triggerServerEvent("toggleEngine", resourceRoot ) outputDebugString ( tostring ( source ) .. " clicked." ) end end end addEventHandler("onClientGUIClick", theButton, handleButton) -- Server function switchEngine () local theVehicle = getPedOccupiedVehicle ( client ) if theVehicle and getVehicleController ( theVehicle ) == client then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end addEvent("toggleEngine", true) addEventHandler ("toggleEngine", resourceRoot, switchEngine) addCommandHandler ("engine", switchEngine )
    1 point
  2. hi you can try this but i didn't test it --Client addEvent("playWinSound", true) addEventHandler("playWinSound", root, function(soundFile) local sound = playSound(soundFile) --play the sound file that comes as a parameter setSoundVolume(sound, 1) setSoundMaxDistance(sound, 100) end ) --server function multi_sounds(player, commandName, soundType) if not (soundType) then return outputChatBox("You must be enter sound type.", player) end --if the player has not entered the soundType, exit immediately if(soundType == "cops") then --if soundType is "cops" enter here triggerClientEvent(player, "playWinSound", player, "sirens.mp3") elseif(soundType == "robbers") then --if soundType is "robbers" enter here triggerClientEvent(player, "playWinSound", player, "gangsters.mp3") end end addCommandHandler("win", multi_sounds)
    1 point
  3. addEventHandler("onVehicleExplode", root, function() setTimer(destroyElement,3000,1,source) end)
    1 point
  4. Not sure if this can be even better. Try this one: addEventHandler("onVehicleExplode", root, function() setTimer(destroyElement(),3000,1,source) end)
    1 point
×
×
  • Create New...