Dzakub Posted October 10, 2010 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)
dzek (varez) Posted October 10, 2010 Posted October 10, 2010 read more wiki. source of onPlayerPickupHit event is PICKUP. and you are trying to trigger client event on PICKUP. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
Dzakub Posted October 10, 2010 Author 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
dzek (varez) Posted October 10, 2010 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 Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
50p Posted October 10, 2010 Posted October 10, 2010 You may want to use onPlayerPickupUse instead. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
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