will briggs Posted June 12, 2011 Posted June 12, 2011 Hey, I added a trigger client event and its saying bad argument at triggerclient event. Im not sure whats wrong Heres my server (not all of it) addEventHandler('onColShapeHit', Col, function(hitElement, dim) if getElementType(hitElement) == 'player' then if getTeamName(getPlayerTeam(hitElement))=="Police" then moveObject(Barrier, 1000, 1544.69, -1630.8, 13.3, 0, -90, 0) triggerClientEvent ( player, "beep" ) end end end ) And my client function beep ( ) playSoundFrontEnd ( 5 ) end Whats wrong with it
Castillo Posted June 12, 2011 Posted June 12, 2011 addEventHandler('onColShapeHit', Col, function(hitElement, dim) if getElementType(hitElement) == 'player' then if getTeamName(getPlayerTeam(hitElement))=="Police" then moveObject(Barrier, 1000, 1544.69, -1630.8, 13.3, 0, -90, 0) triggerClientEvent ( hitElement, "beep", hitElement ) end end end )
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks but no errors given > Doesnt play sound..
Castillo Posted June 12, 2011 Posted June 12, 2011 (edited) Well, maybe something else is wrong, and btw, why do you need a trigger for a function that it's also server side..? addEventHandler('onColShapeHit', Col, function(hitElement, dim) if getElementType(hitElement) == "player" then if getTeamName(getPlayerTeam(hitElement))=="Police" then moveObject(Barrier, 1000, 1544.69, -1630.8, 13.3, 0, -90, 0) playSoundFrontEnd (hitElement, 5) end end end ) Edited June 12, 2011 by Guest
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks, but i tried it server side but it never worked, but i know the script works ...
will briggs Posted June 12, 2011 Author Posted June 12, 2011 No, its saying bad event at play front endsound. :\
JR10 Posted June 12, 2011 Posted June 12, 2011 (edited) playSoundFrontEnd(hitPlayer, 5) should be playSoundFrontEnd(hitElement, 5) and before in your first code function beep ( ) playSoundFrontEnd ( 5 ) end did you add the event? like this? function beep ( ) playSoundFrontEnd ( 5 ) end addEvent("beep", true) addEventHandler("beep", root, beep) Edited June 12, 2011 by Guest
JR10 Posted June 12, 2011 Posted June 12, 2011 ... and he didnt add the event in his first code he just named the function "beep".
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks, Changed it to hitElement and it works now. Thanks
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