12p Posted January 5, 2011 Posted January 5, 2011 res = getThisResource() addEvent ("onPlayerCallMission",true) function callMission (theMission) call (res,theMission,source) end addEventHandler ("onPlayerCallMission",getRootElement(),callMission) Simple script. I think what I'm doing it's okay, but when it triggers the event "onPlayerCallMission" it tells me "Bad Argument @ addEventHandler". That problem is in those lines. Am I doing any wrong thing?
Kenix Posted January 6, 2011 Posted January 6, 2011 res = getThisResource() addEvent ("onPlayerCallMission",true) function callMission (theMission) call (res,theMission,source) end addEventHandler ("onPlayerCallMission",getRootElement(),callMission) Simple script. I think what I'm doing it's okay, but when it triggers the event "onPlayerCallMission" it tells me "Bad Argument @ addEventHandler". That problem is in those lines. Am I doing any wrong thing? try this , I could be wrong. res = getThisResource() addEvent ("onPlayerCallMission",true) function callMission (theMission) call (res,theMission,source) end addEventHandler ("onPlayerCallMission",getResourceRootElement(getThisResource()),callMission) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Aibo Posted January 6, 2011 Posted January 6, 2011 what's the point in call() within the same resource? ?
12p Posted January 6, 2011 Author Posted January 6, 2011 (edited) you would understand me if you know the reason... And thanks, volk, I will check and edit. EDIT: You were wrong, volk. It didn't work. Whatever, I just got the problem and solved it. Thanks anyway =) Edited January 6, 2011 by Guest
SDK Posted January 6, 2011 Posted January 6, 2011 Do you by any chance mean going from a string (theMission) to a function? If so, you could use _G Learn Lua - Learn to script - GUI scripting Scripter tools - Find/fix errors yourself(!) Don't pm me for scripting help, keep it for the Scripting subforum!
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