Dzakub Posted October 10, 2010 Share Posted October 10, 2010 Hi, I want to trigger a event from server by triggerClientEvent, but it doesn't work. Here's the code: Server: function startTrip() triggerClientEvent(source,"startTrip", source) end addEventHandler("onPlayerPickupHit", getRootElement(), startTrip) Client: addEvent("startTrip",true) addEventHandler("startTrip", getRootElement(), getTrip) Link to comment
dzek (varez) Posted October 10, 2010 Share Posted October 10, 2010 read more wiki. source of onPlayerPickupHit event is PICKUP. and you are trying to trigger client event on PICKUP. Link to comment
Dzakub Posted October 10, 2010 Author Share Posted October 10, 2010 No, you are wrong. The source of this event is the player that hit the pickup. And it is not the problem, my server shows an error that the event startTrip is not added clientside, However if i copy this same code to runcode (by run and crun) it works Link to comment
dzek (varez) Posted October 10, 2010 Share Posted October 10, 2010 first: you should always tell us EXACT error. second: you are right, i was wrong, just didnt read carefully - and this is caused because you wont tell its triggering any error third: ill try it now edit: http://upload.dzek.metal.info/pliki/test.rar its working Link to comment
50p Posted October 10, 2010 Share Posted October 10, 2010 You may want to use onPlayerPickupUse instead. 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