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 Founder of SAUR - Founder/Owner of ARC RPG
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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks but no errors given > Doesnt play sound.. Founder of SAUR - Founder/Owner of ARC RPG
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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ... Founder of SAUR - Founder/Owner of ARC RPG
Castillo Posted June 12, 2011 Posted June 12, 2011 Does it work now? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
will briggs Posted June 12, 2011 Author Posted June 12, 2011 No, its saying bad event at play front endsound. :\ Founder of SAUR - Founder/Owner of ARC RPG
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 Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Castillo Posted June 12, 2011 Posted June 12, 2011 Oh, my bad, I put hitPlayer but it was hitElement San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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". Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks, Changed it to hitElement and it works now. Thanks Founder of SAUR - Founder/Owner of ARC RPG
JR10 Posted June 12, 2011 Posted June 12, 2011 No problem. you should say thanks to solidsnake too. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
will briggs Posted June 12, 2011 Author Posted June 12, 2011 Thanks Castillo =) Founder of SAUR - Founder/Owner of ARC RPG
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