Jump to content

Bad Argument @ addEventHandler - WHAT THE HELL!


12p

Recommended Posts

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?

Link to comment
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) 
  

Link to comment

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 by Guest
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...