'LinKin Posted April 15, 2014 Share Posted April 15, 2014 Hi, When using onSettingChange event. Is it possible to pass as an argument, the player who changes the setting? I remember I saw this somewhere as an example, they were passing these arguments to the function: function(theSetting, oldValue, newValue, thePlayer) I've tested but thePlayer is nil.. Also, When a setting gets changed it displays in the chatbox a message. Ex: Set 'inkcw.changeMapTime' to '123' How is this message displayed only to the player who changes the setting? Thanks. Link to comment
Moderators IIYAMA Posted April 15, 2014 Moderators Share Posted April 15, 2014 If the argument isn't giving and the source isn't the player, then you can't. The only way to do so, is by editing the script that is doing it. (admin probably) Link to comment
'LinKin Posted April 15, 2014 Author Share Posted April 15, 2014 I wonder how the message "Set 'inkcw.changeMapTime' to '123'" is only displayed to the player who changes the setting.. :\ Link to comment
Moderators IIYAMA Posted April 15, 2014 Moderators Share Posted April 15, 2014 Well, why don't you take a look? Link to comment
'LinKin Posted April 15, 2014 Author Share Posted April 15, 2014 Searched in the whole admin resource. Didn't find the line where it displays this message Link to comment
cheez3d Posted April 15, 2014 Share Posted April 15, 2014 Maybe the resource uses a client -> server -> client path for changing settings. Example: you click on a button to change a value of a setting -> the client sends your data to the server and then if successful triggers a callback client event that will output in the chatbox that message (as it is only visible to you if it is used clientside). Link to comment
Castillo Posted April 15, 2014 Share Posted April 15, 2014 I wonder how the message "Set 'inkcw.changeMapTime' to '123'" is only displayed to the player who changes the setting.. :\ Well, it's quite easy, the admin panel sends each action to the server side, which includes the admin who did the action, it doesn't output that message using that event. Link to comment
'LinKin Posted April 15, 2014 Author Share Posted April 15, 2014 I searched Server and Client files of the Admin resource. I didn't find the line where it sends the message to the server. Hmm.. But I found something, I found this event like this: addEvent("onSettingChange", false) addEventHandler("onSettingChange", root, function(name, oldvalue, value, playeradmin) cache() end) It's plassing a 4th argument Link to comment
Castillo Posted April 15, 2014 Share Posted April 15, 2014 The admin panel has a XML file with the messages, then the script reads which one it has to send depending on the action executed. 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