'LinKin Posted April 15, 2014 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. Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Moderators IIYAMA Posted April 15, 2014 Moderators 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) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
'LinKin Posted April 15, 2014 Author Posted April 15, 2014 I wonder how the message "Set 'inkcw.changeMapTime' to '123'" is only displayed to the player who changes the setting.. :\ Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Moderators IIYAMA Posted April 15, 2014 Moderators Posted April 15, 2014 Well, why don't you take a look? Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
'LinKin Posted April 15, 2014 Author Posted April 15, 2014 Searched in the whole admin resource. Didn't find the line where it displays this message Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
cheez3d Posted April 15, 2014 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).
Castillo Posted April 15, 2014 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
'LinKin Posted April 15, 2014 Author 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 Need a clanwar script? Click here! Do you want some free scripts for your DD server? Visit my website.
Castillo Posted April 15, 2014 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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