Trickydude19 Posted September 26, 2009 Share Posted September 26, 2009 Hi, I run a race server on MTA 1.0 and I was wondering if someone would be kind enough to script a colored name script for me. Meaning, everybody who comes on the server gets a random color for their name when they join. I'm not really good at scripting but any help would be much appreciated! Link to comment
darkdreamingdan Posted September 27, 2009 Share Posted September 27, 2009 Start the "playercolors" resource Link to comment
Trickydude19 Posted September 27, 2009 Author Share Posted September 27, 2009 K, now I feel like an idiot. I must've skipped over that resources hundreds of times and not even think twice about it haha. Thanks a lot Link to comment
Trickydude19 Posted September 27, 2009 Author Share Posted September 27, 2009 Well hmm, kind of strange. When a race is over and moves on to the next map, all the usernames are back to white again. Any idea how to fix this? Thanks! Link to comment
Gamesnert Posted September 27, 2009 Share Posted September 27, 2009 Playercolors seems to use nametag colors to color the chat. However, if a new map is started, this is being reset by mapmanager. Therefore, you need a slight change in the code. In playercolors.lua (open it with notepad) replace: addEventHandler ( "onResourceStart", g_ResourceRoot, function() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end ) With: function applyPlayerColors() for i,player in ipairs(getElementsByType"player") do processPlayer ( player ) end end addEventHandler ( "onResourceStart", g_ResourceRoot,applyPlayerColors ) addEventHandler ( "onGamemodeMapStart", g_Root,applyPlayerColors ) This is pretty much the easiest solution. However, the colors will still randomly change after a map change. There are ways around this, but I guess this isn't such a serious issue anyways. (and it probably is a relief for people who get pink as random color) Link to comment
Trickydude19 Posted September 27, 2009 Author Share Posted September 27, 2009 You would be surprised how many people in my clan vow for the pink nametag, ROFL. Also, worked like a charm, thanks for the help! 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