pa3ck Posted August 4, 2013 Share Posted August 4, 2013 Hi guys. As far as I know, whenever I use the addEventHandler the syntax is this (this is the exact code I'm using): addEventHandler('onResourceStart', resRoot, gpsSystem ) BUT it wont start with this code. But if I put this: addEventHandler('onResourceStart', resRoot, gpsSystem() ) It is working. Why is that? Also, in debugscript I'm getting a warning when I use the brackets WARNING: gps_system\c_gps.lua:220 Bad argument @ 'addEventHandler' [Expected function at argument 3, got none] Am I this stupid or what? Whenever I used an event or command handler I put the function name without brackets. Link to comment
pa3ck Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) removed Edited August 4, 2013 by Guest Link to comment
xXMADEXx Posted August 4, 2013 Share Posted August 4, 2013 addEventHandler('onResourceStart', resRoot, gpsSystem() ) Should be addEventHandler('onClientResourceStart', resRoot, gpsSystem ) 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