Welcome, Guest. Please login or register.
Did you miss your activation email?
September 20, 2024, 07:05:49 AM
Home Help Login Register
News: Zombie Master 2 discussion

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Way to thank players for donations?
Pages: [1] 2
Author Topic: Way to thank players for donations?  (Read 24054 times)
NaRyan
Poster

Posts: 98


Less QQ more Pew Pew


« on: July 20, 2010, 11:21:43 PM »

I have had a few players donate/offer donations for my 2 servers.

So I was wondering is there an easy way to show players who have donated by making them have a different coloured name in the scoreboard?
Same way as Admins show up gold, make players who have made a donation show up as Green name?

I'm not interested in the VIP/limited Admin/Increased traitor chance stuff.
Just a non-gamemode changing thank you for players.

Gimme a joint and 3 hours and I can come up with a logical system for karma :D
AndyTheGeeky
Build Tester
*
Posts: 3026


Wannabe Zoidberg


« Reply #1 on: July 20, 2010, 11:24:18 PM »

I love that you're doing this instead of messing with the gamemode, and I'd donate if I played on your server and had any money.
Unfortunately, I have no idea how you'd do this.  It'd probably involve an addon and adding them as some level of ULX (with no real access benefit), but that's the best I can think of.

Signature Pending...
DemiGod
Build Tester
*
Posts: 1289


Nimble as a pregnant cow


« Reply #2 on: July 21, 2010, 12:38:55 AM »

Doesn't Rot have a pink name in zombie master? I'm sure it would be similar to coding that so BKU might know

I hate all of you
Nah, more like demigod isn't self centered and he is legality cool guy.
AndyTheGeeky
Build Tester
*
Posts: 3026


Wannabe Zoidberg


« Reply #3 on: July 21, 2010, 12:43:52 AM »

I think that was hard-coded into 1.2.1 following that incident.

Signature Pending...
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #4 on: July 21, 2010, 01:03:42 AM »

This is entirely possible, and is in fact implemented to a point.
In the terrortown\gamemode\vgui file sb_row.lua, BKU added his own SteamID to display his name green.

Since the green is built in, you can manually add SteamIDs quite easily.

For instance, on Line 62 and 63, it shows

if ply:SteamID() == "STEAM_0:0:1963640" then
        return namecolor.dev

If you were to add an else if underneath that, like...

elseif ply:SteamID() == "STEAM_0:0:202020" then
        return namecolor.dev

Then you can have your own.


Here's an example of what it might look like:

local function ColorForPlayer(ply)
  if IsValid(ply) then
      if ply:SteamID() == "STEAM_0:0:1963640" then
        return namecolor.dev

      elseif ply:SteamID() == "STEAM_0:0:201402" then
        return namecolor.dev
      elseif ply:SteamID() == "STEAM_0:1:339212" then
        return namecolor.dev

      elseif ply:IsAdmin() and GetGlobalBool("ttt_adminhl", true) then
        return namecolor.admin
      end
  end
  return namecolor.default
end


This probably isn't an optimized method of doing this, but it will definitely work.


If you want I can do it for you, just give me the list of SteamIDs that you want greenified

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
Kiwiâ„¢
Build Tester
*
Posts: 2398


Trendy and Dry


« Reply #5 on: July 21, 2010, 02:34:51 AM »

Man, why ya gotta push yourself in on what the man who made this made for himself.

Quote
Worbat: You killing me constantly was so frustrating, I quit in disgust.

Quote
[16:47] Jeff: British is not an ancestry. Britain is an accident of noble marriages, pregnancies, and deaths.
Rotinaj
Build Tester
*
Posts: 5107


the brave


« Reply #6 on: July 21, 2010, 03:25:44 AM »

Doesn't Rot have a pink name in zombie master?


>:(
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #7 on: July 21, 2010, 08:23:18 AM »

This is entirely possible, and is in fact implemented to a point.
In the terrortown\gamemode\vgui file sb_row.lua, BKU added his own SteamID to display his name green.

Yeah I wouldn't recommend this method. It will take about five seconds for someone to change their name to mine and start fucking with people. Better to use a different colour than green.

I could add a hook to make that really easy and not require any modification of gamemode files. You'll have to wait until the update is released though.
Charles445
Build Tester
*
Posts: 2338


I LOVE THIS AVATAR


« Reply #8 on: July 21, 2010, 01:55:24 PM »


Good point BKU.

Here's how to change said color.

TO ADD YOUR OWN CUSTOMIZED COLOR

At line 54 of that same file, all the colors are set.
You can safely add your own. For instance, if we wanted cyan, it would look like this...

local namecolor = {
  default = COLOR_WHITE,
  admin = Color(220, 180, 0, 255),
  dev = Color(100, 240, 105, 255),
  donor = Color(100 240 240)
};

Then, instead of return namecolor.dev, we'd use return namecolor.donor

local function ColorForPlayer(ply)
  if IsValid(ply) then
      if ply:SteamID() == "STEAM_0:0:1963640" then
        return namecolor.dev

      elseif ply:SteamID() == "STEAM_0:0:201402" then
        return namecolor.donor
      elseif ply:SteamID() == "STEAM_0:1:339212" then
        return namecolor.donor

      elseif ply:IsAdmin() and GetGlobalBool("ttt_adminhl", true) then
        return namecolor.admin
      end
  end
  return namecolor.default
end

del>Ok, so Bad King, you are just going to wait for Garry to fix?
What an idiotic thing to ask. Dammit weed.

Bookcases, Bookcases Everywhere
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #9 on: July 21, 2010, 02:22:13 PM »

I just added a TTTScoreboardColorForPlayer hook that should eliminate the need to edit TTT files. Here's what I've written as example in the readme:
Quote
There's also a hook for scoreboard name colors:
- TTTScoreboardColorForPlayer
   
It's clientside, and you could use it as follows. Put the below in a text file
in \garrysmod\lua\autorun\ on the server, called scoreboardcolors.lua:

   if SERVER then
      -- when the server loads this script, tell it to send it to clients
      AddCSLuaFile("scoreboardcolors.lua")
   else
      -- when a client runs it, add the hook
      function MySBColors(ply)
         if ply:SteamID() == "PUT A STEAMID HERE" then
            return Color(255, 0, 255)
         end
      end
      hook.Add("TTTScoreboardColorForPlayer", "MySBColors", MySBColors)
   end

Edit in a SteamID to test with, of course. Adding more players and changing
colors should be easy from there.


New version with this in it will be out somewhere in the next few days.
NaRyan
Poster

Posts: 98


Less QQ more Pew Pew


« Reply #10 on: July 21, 2010, 03:06:10 PM »

Thanks for the ideas oh how to do it, and to BKU for adding that hook in the next version :)

And I wont use the colour green, since that is BKU's colour.

Gimme a joint and 3 hours and I can come up with a logical system for karma :D
Soduka
Poster

Posts: 680



« Reply #11 on: July 21, 2010, 05:13:02 PM »

I just added a TTTScoreboardColorForPlayer hook that should eliminate the need to edit TTT files. Here's what I've written as example in the readme:
New version with this in it will be out somewhere in the next few days.


Did you lock your color?
Kologer0s
Poster

Posts: 48


« Reply #12 on: July 21, 2010, 05:15:30 PM »

Also since everyone starts with a crowbar is there a way to make a script for selected people to start with like a golden one or any other skin? (Saw rainbow one on gmod.org, yay for gayness)

http://bit.ly/Mogzcom MOGZ Gmod TTT + Killing Floor Servers
Bad King Urgrain
Administrator
*****
Posts: 12276



« Reply #13 on: July 21, 2010, 06:41:23 PM »

Did you lock your color?

Nope. That would be futile, as I'd have to block a whole range of colours similar to that shade of green. It's not a huge problem in the first place, I just wouldn't outright recommend using green. Same for the gold/yellow colour that's used for admins.

Also since everyone starts with a crowbar is there a way to make a script for selected people to start with like a golden one or any other skin? (Saw rainbow one on gmod.org, yay for gayness)

This would take a lot more work than just a scoreboard colour change. You'd need a separate model with that different skin, and then modify the weapon to use that model when one of those selected people picks it up.
Kologer0s
Poster

Posts: 48


« Reply #14 on: July 21, 2010, 11:14:23 PM »

Well everyone starts with a crowbar, just need to find a way to make it so that they start with the other model instead if they are marked as donors with the colored name on scoreboard

http://bit.ly/Mogzcom MOGZ Gmod TTT + Killing Floor Servers
bigbadboo
Poster

Posts: 287


« Reply #15 on: July 22, 2010, 01:02:27 AM »

What about a star above players heads when in the preparing mode? Saw this in TF2 once using SM. Should not be impossible to code.
Pastor
Build Tester
*
Posts: 2192


Bewildering Transvestite Wasteland


« Reply #16 on: July 22, 2010, 01:07:33 AM »

-oh god he killed him!
-who?
-i dunno he had a rainbow crowbar!
then everyone with rainbow crowbar dies

bigbadboo
Poster

Posts: 287


« Reply #17 on: July 22, 2010, 09:36:58 AM »

-oh god he killed him!
-who?
-i dunno he had a rainbow crowbar!
then everyone with rainbow crowbar dies


That is why VIP weapons are flawed for traitors.
Kologer0s
Poster

Posts: 48


« Reply #18 on: July 22, 2010, 12:44:59 PM »

ok so a guy gets slowly crowbarred to death and NOBODY notices it? you guys playing in pretty fail servers there....

http://bit.ly/Mogzcom MOGZ Gmod TTT + Killing Floor Servers
Marauder8
Build Tester
*
Posts: 4639


Future Emperor of Antarctica


« Reply #19 on: July 22, 2010, 01:01:01 PM »

He could have low health.

THIS RAINCOAT IS FROM THE DEVIL
Pages: [1] 2
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Way to thank players for donations? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.011 seconds with 18 queries.