will briggs Posted June 12, 2011 Share 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 Link to comment
Castillo Posted June 12, 2011 Share 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 ) Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 Thanks but no errors given > Doesnt play sound.. Link to comment
Castillo Posted June 12, 2011 Share 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 Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 Thanks, but i tried it server side but it never worked, but i know the script works ... Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 No, its saying bad event at play front endsound. :\ Link to comment
JR10 Posted June 12, 2011 Share 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 Link to comment
Castillo Posted June 12, 2011 Share Posted June 12, 2011 Oh, my bad, I put hitPlayer but it was hitElement Link to comment
JR10 Posted June 12, 2011 Share Posted June 12, 2011 ... and he didnt add the event in his first code he just named the function "beep". Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 Thanks, Changed it to hitElement and it works now. Thanks Link to comment
JR10 Posted June 12, 2011 Share Posted June 12, 2011 No problem. you should say thanks to solidsnake too. Link to comment
will briggs Posted June 12, 2011 Author Share Posted June 12, 2011 Thanks Castillo =) 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