R.y.c.k Posted June 22, 2012 Share Posted June 22, 2012 (edited) do not know where I have an error? When it receives hunter should play a song that everybody should hear. client local player = nil function thePlayerReachedHunter() if (player) then dxDrawText("The player ".. tostring(getPlayerName(player)) .." got police car",155.0,549.0,669.0,591.0,tocolor(255,255,255,255,true),1.0,"default-bold","left","top",false,false,false) end end addEvent("disableGhostMode",true) addEventHandler("disableGhostMode",root, function (thePlayer) player = thePlayer outputChatBox ( "#FFE303The ghostmode will be disabled in 5 seconds ",255,255,255 ,true ) addEventHandler ( "onClientRender", root, thePlayerReachedHunter ) setTimer(function () removeEventHandler ( "onClientRender", root, thePlayerReachedHunter ) end, 5000, 1) setTimer(function () for k,v in ipairs(getElementsByType("vehicle")) do setElementCollidableWith(v, v, true) end end, 5000, 1) end) function sound (ReachedHunter,PlayerReachedHunter) local sound = playSound("turbo.mp3") sounds folder setSoundVolume(sound, 0.5) end addEventHandler("thePlayerReachedHunter", getLocalPlayer(), sound) server function someoneReachedHunter(number, sort, model) if (sort == "vehiclechange" and model == 821) then triggerClientEvent("playSound",getRootElement(),source) end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("thePlayerReachedHunter",getRootElement(),playSound) addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) Edited June 22, 2012 by Guest Link to comment
Guest Guest4401 Posted June 22, 2012 Share Posted June 22, 2012 addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",root, function(id,ptype,model) if ptype == "vehiclechange" and model == 425 then triggerClientEvent("cPlaySound",root) end end ) addEvent("cPlaySound",true) addEventHandler("cPlaySound",root, function() setSoundVolume( playSound("hunter.mp3"), 0.5 ) end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now