kevin11 Posted May 7, 2010 Share Posted May 7, 2010 addEventHandler( "onZombieWasted", getRootElement(), function( killer ) givePlayerMoney( killer, 100 ); end ) this isnt working can someone help me Link to comment
BladeArtist Posted May 7, 2010 Share Posted May 7, 2010 Show me the function that triggers your event, please. As far as I know, the problem is not this function here. Also, the semicolon( after givePlayerMoney() isn't necessary. Anyway, the function that triggers this event should be passing the parameter "killer", since you're using it in the handler. i.e. something like: triggerServerEvent("onZombieWasted", zombieElement, killer [, other parameters]) where "zombieElement" is defined within the scope of this event trigger, before you trigger it, as well as the "killer" variable (that being a player element). I would really have to see the rest of your script to be able to help you better. I have no idea how you're handling these "zombie elements", for instance. Hope that helps a little, BladeArtist Link to comment
dzek (varez) Posted May 7, 2010 Share Posted May 7, 2010 kevin, are you sure you have the newest version of zombie script? BladeArtist, he knows NOTHING about lua, so asking these questions are pointless ;/ kevin, be sure to set this serverside.. and if something is not working, try to DEBUG it. how to debug: login as admin (in-game) and in console type: "debugscript 3" debug window will appear on the bottom of screen.. write here any errors you can find in debug window Link to comment
50p Posted May 8, 2010 Share Posted May 8, 2010 Add this above addEventHandler, if it still doesn't get triggered: addEvent( "onZombieWasted" ); Link to comment
eAi Posted May 9, 2010 Share Posted May 9, 2010 I'm interested why scripters think it's the event consumer's responsibility to add the event, rather than the event emitter's? When I envisioned this system, I expected the resource that triggered event to register the event. Link to comment
robhol Posted May 9, 2010 Share Posted May 9, 2010 I'm interested why scripters think it's the event consumer's responsibility to add the event, rather than the event emitter's? When I envisioned this system, I expected the resource that triggered event to register the event. When events are being fired intra-resource across server-client, you almost have to declare it on the receiving side... Unless I've missed something major and you can actually add events for "the other side", but that makes little sense. Link to comment
50p Posted May 10, 2010 Share Posted May 10, 2010 I'm interested why scripters think it's the event consumer's responsibility to add the event, rather than the event emitter's? When I envisioned this system, I expected the resource that triggered event to register the event. When events are being fired intra-resource across server-client, you almost have to declare it on the receiving side... Unless I've missed something major and you can actually add events for "the other side", but that makes little sense. To me it makes no sense if each resource need to add new event (which was already made by other resource). If you add an event, it should be accesses from all resources... I don't know why but addEvent sometimes solves the problem of events not being triggered, "sometimes" because usually it's scripter's fault when attaching events to wrong elements but in this case root element is correct. Link to comment
JasperNL=D Posted May 31, 2010 Share Posted May 31, 2010 sadly noob posted this on the community >_> https://community.multitheftauto.com/index.php?p= ... &id=250603 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