TheCapn Posted March 8, 2014 Share Posted March 8, 2014 Hello guys, I would like to trigger an client event only for on player, but actually when I trigger it, it triggers for every one. Here's my code function loginHandler(username, password) ... triggerClientEvent(getRootElement(), "onBan", getRootElement(), banauthor, banreason, bantime) ... end Username and password are only strings. Regards, Link to comment
Discord Moderators Megadreams Posted March 8, 2014 Discord Moderators Share Posted March 8, 2014 You are using getRootElement() instead of the pointer to the player. Are you calling this function from a client call or are you using the onPlayerLogin event? In the first case you should use "client" (source isn't safe enough) and in the second case you should use "source". So these are the two possibilities: triggerClientEvent(client, "onBan", getRootElement(), banauthor, banreason, bantime) or triggerClientEvent(source, "onBan", getRootElement(), banauthor, banreason, bantime) Link to comment
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