Evening. I developpe very much in other languages - but I never ever touched python or lua.
My bad, because now I even don't know how to write a simple and stupid if-else-block!
Original:
I want to replace the player name (ply.__dict__) by another word but it doesn't work and I cannot find whyCode:self.say(MSG['JOIN MESSAGE'].format(**ply.__dict__), COLORS['JOIN MESSAGE'], uid)
The server join message looks like this:Code:if PLUGIN['ENABLE ANONYMOUS JOIN/LEAVE MESSAGE']: pname = "Someone" else: pname = ply.__dict__self.say(MSG['JOIN MESSAGE'].format(**pname), COLORS['JOIN MESSAGE'], uid)
Can someone help me please?Code:"<lime>{username}<end> from <orange>{country}<end> joined the server."
[DOUBLEPOST=1457611306,1457549757][/DOUBLEPOST]For everyone using the notifier-plugin:
Everytime someone joins the server, it's written to the chat with player-name.
I wanted to have a option like "ENABLE ANONYMOUS JOIN/LEAVE MESSAGE". Like this you can put the following to python.py in joining_messages():
If this option is enabled, the server writes now "Someone joined the server, from -country-" to the chat instead of the username.Code:#Join message # ...userdata = ply.__dict__ if PLUGIN['ENABLE ANONYMOUS JOIN/LEAVE MESSAGE']: userdata["username"] = "Someone"self.say(MSG['JOIN MESSAGE'].format(**userdata), COLORS['JOIN MESSAGE'], uid)
Solved Trouble with player name replacement (Python)
Discussion in 'Rust Development' started by b1343779, Mar 10, 2016.