Jump to content

onPlayerClientJoin


DLmass

Recommended Posts

Posted

I have some issues with this. No idea if it's a bug or not. Will someone let me know?

  
function checkTransferBox() 
    if not isTransferBoxActive() then 
        outputDebugString("Not visible, proceed") 
    else 
        setTimer(checkTransferBox, 2000, 1) 
        outputDebugString("Still visible, do not proceed") 
    end 
end 
addEventHandler("onClientPlayerJoin", root, checkTransferBox) 
  

Posted

Dunno what exactly the problem is.

You didn't tell the bug.

You should maybe use onClientResourceStart ...

onClientPlayerJoin should be totally wrong here

Posted

Try this one:

  
addEventHandler ("onClientPlayerJoin", root, 
     function () 
          setTimer (checkTimer, 2000, 1) 
     end 
) 
  
function checkTimer () 
    if not isTransferBoxActive() then 
        outputDebugString("Not visible, proceed") 
    else 
        setTimer(checkTransferBox, 2000, 1) 
        outputDebugString("Still visible, do not proceed") 
    end 
end 
  

  • MTA Team
Posted
Try this one:
  
addEventHandler ("onClientPlayerJoin", root, 
     function () 
          setTimer (checkTimer, 2000, 1) 
     end 
) 
  
function checkTimer () 
    if not isTransferBoxActive() then 
        outputDebugString("Not visible, proceed") 
    else 
        setTimer(checkTransferBox, 2000, 1) 
        outputDebugString("Still visible, do not proceed") 
    end 
end 
  

onClientPlayerJoin should be totally wrong here
Posted

I'm not telling anyone whether if onClientPlayerJoin is wrong or not. I'm just telling him how it works. Not up to me to decide which events to use, so instead of replying me whether it's right or wrong, post the solution

Posted

qaisjp explained to me on IRC what it does and does not. Thanks again mate!

I've replaced onClientPlayerJoin with onClientResourceStart which made it work.

  • MTA Team
Posted
post the solution

No. That's not what people on this subforum should be doing.

We've been saying this for six damn years - providing the solution directly achieves nothing. The person asking the question will simply carry on asking questions and won't learn anything because they've been spoon fed everything.

Help people come to their own solution by teaching them what's right, what's wrong, and what they need to do next.

Sure, if you want to post the solution, feel free. But you better damn well explain what you've done.

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...