[DKR]silverfang Posted July 9, 2008 Share Posted July 9, 2008 Right I want to force a player as the client for a script, The script is a rules and FAQ window that shows when a player joins the server, with two buttons, "accept" and "decline" if accept is pressed then access to the server is granted, if decline is pressed then they are kicked from the server, displaying a message to server. I want to add a function that when a staff member types "rules " in the console then the player will be shown the window again, but I don't know how to make it so that the 'targetPlayer' is the client. Cheers in advance. Link to comment
[DKR]silverfang Posted July 9, 2008 Author Share Posted July 9, 2008 getPlayerFromNick("robhol"); No that's just how to get the player from the name, not what I was asking, I have already used that function, I need to force the player - that is returned from that function - so that the client script is active for them. Tell me if I'm not making much sense. Link to comment
robhol Posted July 9, 2008 Share Posted July 9, 2008 Add a remote triggerable event client-side, add a handler function that shows the GUI, trigger from server-side when necessary. Link to comment
[DKR]silverfang Posted July 9, 2008 Author Share Posted July 9, 2008 Add a remote triggerable event client-side, add a handler function that shows the GUI, trigger from server-side when necessary. But wont that still be the person who typed the command? Link to comment
Gamesnert Posted July 9, 2008 Share Posted July 9, 2008 Make a custom event for showing the window. So for example: ... addEvent("forceClientToSeeRules",true) addEventHandler("forceClientToSeeRules",getRootElement(),showRulesWindow) ... And then serverside: function forceRules(somebody, commandName, player) local player=getPlayerFromName(player) triggerClientEvent(player,"forceClientToSeeRules",somebody) end addCommandHandler("rules",forceRules) Something like that. Since I'm pretty new, you might want to double-check the code. But for the biggest part, it should do the trick. --------------------------------------------------- Response to new post posted before mine: The way I did it, somebody is the source, and player is the target. So no in the case of my example. 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