pa3ck Posted August 4, 2013 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.
golanu21 Posted August 4, 2013 Posted August 4, 2013 give the full code [Dev]BloWnRPG - We BloW the World [1%]
pa3ck Posted August 4, 2013 Author Posted August 4, 2013 (edited) removed Edited August 4, 2013 by Guest
xXMADEXx Posted August 4, 2013 Posted August 4, 2013 addEventHandler('onResourceStart', resRoot, gpsSystem() ) Should be addEventHandler('onClientResourceStart', resRoot, gpsSystem ) The Ultimate Lua Tutorial! | MTA PHP SDK
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