Jump to content

triggerClientEvent Problem


Overkillz

Recommended Posts

Hey there, I have a little problem triggering to a Local user (Just the local user)

well, my problem is, when the player press the L and If he hasn't any lang chosen, then make a trigger to chose the lang.

It works perfectly with command, but IDK why is wrong.

  
-- Trigger Server 
triggerClientEvent("onToggleLang",resourceRoot,true) 
  
-- Client Event 
addEvent ( "onToggleLang", true ) 
addEventHandler ( "onToggleLang", getRootElement(),toggleLang) 
  

If you need another part of the script, just ask me.

Regards.

Link to comment

Thanks guys, I wasn't notified that I have defined thePlayer in the name of function and now it works perfect

now it is fixed ^^

start of my code fixed by u guys ^^:

function langChat(thePlayer, cmd, ...) 
    local mycountry = getElementData(thePlayer, "langShi") 
    if not mycountry then 
    triggerClientEvent(thePlayer,"onToggleLang",thePlayer) 
    return end 
--... rest of code 

Thanks newly

Regards.

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