Mittell Buurman Posted August 11, 2013 Posted August 11, 2013 The issue is as followed: I have a serverside event calling a clientside event, but it doesnt trigger at all. I have tried several attempts, but I get nothing. Not even a debugmessage both on the console, nor the debugscript. Client addEventHandler("account:login:attempt", getRootElement(), function() outputChatBox("Hello") fadeCamera(true) setCameraTarget(client, client) setCameraMatrix(0, 0, 5, 100, 100, 10) end ); Server addEventHandler("onPlayerJoin", getRootElement(), function() -- I tried to remove the source on the first argument aswell, no results whatsoever, I tried getRootElement(), same results triggerClientEvent(source, "account:login:attempt", source) end ); Global(client & server) addEvent("account:login:attempt", true)
TAPL Posted August 11, 2013 Posted August 11, 2013 (edited) I guess the client side script haven't started yet when you have send the trigger. And client can be used server side only. You don't need for the trigger, just use the event onClientResourceStart in client side. Edited August 11, 2013 by Guest
tosfera Posted August 11, 2013 Posted August 11, 2013 The eventhandlers does not support tokens like ( " ' , ). Change the name; account:login:attempt to this; account_login_attempt
Mittell Buurman Posted August 11, 2013 Author Posted August 11, 2013 The eventhandlers does not support tokens like ( " ' , ). Change the name; account:login:attempt to this; account_login_attempt I tested it and it does support : tags. I guess the client side script haven't started yet when you have send the trigger.And client can be used server side only. You don't need for the trigger, just use the event onClientResourceStart in client side. I use the trigger for a purpose, I discovered that the addEvent does work in the script itself, but for some reason it doesnt work when I put it in the global file.
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