Ulysses

Ulysses Stuff => Releases => Topic started by: Bite That Apple on February 06, 2013, 05:59:14 PM

Title: Player Chat Tags
Post by: Bite That Apple on February 06, 2013, 05:59:14 PM
GO TO THIS LINK FOR THE NEW VERSION OF THIS ADDON I MADE

http://forums.ulyssesmod.net/index.php/topic,6196.msg29251.html
Title: Re: Player Chat Tags
Post by: Nightmare2244 on February 06, 2013, 06:09:02 PM
Would you happen to have any ULX chat tags that say like Super-Admin and Owner next to their name?
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 06, 2013, 07:28:28 PM
Would you happen to have any ULX chat tags that say like Super-Admin and Owner next to their name?

This is how this script works. When you create a group, you must create a team using XGUI. As long as you have a team created in XGUI and apply it to one of the groups, everything will work fine.

If this didn't answer your question, please ask it in a different way :/
Title: Re: Player Chat Tags
Post by: Nightmare2244 on February 06, 2013, 08:08:19 PM
Like when someone speaks it looks like this

(Super-Admin) Nightmare: Test

or

(Owner) Nightmare: Owner

etc...

(Trusted) Nightmare: Trusted
Title: Re: Player Chat Tags
Post by: Mesmaroth on February 06, 2013, 08:12:19 PM
I think he means like when a Admin is in a RP class can he let others know if he is Super Admin or Admin just just by the chat tags. Anyways thanks for this man. Keep it coming. Do you mind me asking where did you learn Lua and how long have you been?
Title: Re: Player Chat Tags
Post by: Nightmare2244 on February 07, 2013, 09:37:33 AM
Like I said when ever you type in sandbox it shows what admin rank you are for ULX. Any download and tutorial?
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 07, 2013, 07:50:05 PM
Like I said when ever you type in sandbox it shows what admin rank you are for ULX. Any download and tutorial?

Yeah, the download is located here
https://mega.co.nz/#!jJUGxaoR!JlbYtBDtwGxC8xyAUXwA5z8AsMYqyWmOGAc5TTaXb68
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 07, 2013, 07:56:44 PM
I think he means like when a Admin is in a RP class can he let others know if he is Super Admin or Admin just just by the chat tags. Anyways thanks for this man. Keep it coming. Do you mind me asking where did you learn Lua and how long have you been?

I learned lua from mainly this website http://www.lua.org/ . It's a good place to start, even though Garry's Mod's lua is a bit different, still good to go there.
If you meant other websites besides the lua.org website than there are also these really great (but old wiki's, a bit outdated now but still works amazingly)
http://glua.me/search/ and http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html

The wiki.garrysmod.com wiki sucks really badly, and I suggest if you want to learn lua don't go there. If you need to find hooks or functions I mean you could use that wiki, but I wouldn't really suggest it. Only use it if the function/hook is/are new to garrysmod (if you know they are new), because most likely it won't be on the old wikis' than.
Title: Re: Player Chat Tags
Post by: Mesmaroth on February 08, 2013, 09:15:50 PM
Thank you. I will start learning. How long did it take you to learn basic lua and gmod lua?
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 08, 2013, 10:23:30 PM
Thank you. I will start learning. How long did it take you to learn basic lua and gmod lua?

About two months to learn basic lua, and then about 2 weeks to learn garry's mod lua. Seeing as all lua is the same, garry's mod just adds it's own things.
Title: Re: Player Chat Tags
Post by: datgregofag on February 11, 2013, 06:34:50 PM
I have  a ttt server and it just says (Terrorist) =YBW= Greg: or (Spectator) =YBW= Greg. HOw do i make it so it shows rank.
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 12, 2013, 01:17:36 AM
I have  a ttt server and it just says (Terrorist) =YBW= Greg: or (Spectator) =YBW= Greg. HOw do i make it so it shows rank.

omg.. not these people again (no offense). I don't know whats up with TTT, sorry man. There are threads everywhere on this forum saying things like that... all I can say is it's weird but this should work.




here you go, this is what you're looking for
https://mega.co.nz/#!jN8CTKLR!c4AS-T7b5W991j3ynXb3ana7WWdod9NMJhug5OqbG9s

because this script may be a bit confusing, I'll explain this a bit:

Code: [Select]
local Tags =
{
--Group    --Tag     --Color
{"admin", "ADMIN", Color(0, 0, 255, 255) },
{"superadmin", "SUPERADMIN", Color(255, 0, 0, 255) },
{"owner", "OWNER", Color(0, 255, 0, 255) }
}

Here is the only code you will need to touch. as an example, the name "admin" lowercase
Code: [Select]
{"admin", "ADMIN", Color(0, 0, 255, 255) },is the group name. So if you make a group in ulib/xgui/ttt that's what the first name of it has to be.

The second line that say's "ADMIN" uppercase is the name you can change to anything you want, because this will be the thing that will say "[aGFSDGSDSDFGHSDF]"

The last line that say's color, this will be the thing you can use to color the team name
"[aGFSDGSDSDFGHSDF]" ect...

Title: Re: Player Chat Tags
Post by: datgregofag on February 12, 2013, 02:31:51 PM
Thank You so much, you are really a nice person. I love you. *kiss*
Title: Re: Player Chat Tags
Post by: datgregofag on February 12, 2013, 02:50:21 PM
Just one question how come it does this [[Owner] ] whats up with the extra [ and ]
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 12, 2013, 04:10:22 PM
Just one question how come it does this [[Owner] ] whats up with the extra [ and ]

I would sure love some good 'Karma'... *wink*

Anyways I'm assuming you're using Notepad++ but if you're not I hope you can count "lines".

So on line 6, 7, and 8, the second argument which say's [ADMIN], ect, ect you're going to want to remove those brackets and just have the name Admin or w/e you want it to say.

Also I forgot to mention this, if you want more tags, when adding new lines you need to have a "," at the end of the line always, unless it's the last line.
i.e.
Code: [Select]
{
--Group    --Tag     --Color
{"admin", "ADMIN", Color(0, 0, 255, 255) },
{"superadmin", "SUPERADMIN", Color(255, 0, 0, 255) },
{"owner", "OWNER", Color(0, 255, 0, 255) }
}
Title: Re: Player Chat Tags
Post by: datgregofag on February 12, 2013, 04:36:41 PM
I knew how to do everything except the extra brackets, thank you for all your concern and i hope to get addons from you again!  :) :) :) :)
Title: Re: Player Chat Tags
Post by: datgregofag on February 12, 2013, 05:34:01 PM
I know i might sound annoying but its just cause i suck at lua (LAWL) can you make something that changes name and text color, sort of like this
[Owner] Greg: Hello.  So if you could make me a lua like this that would be great, i could also pay you if you want ( that's how much i respect you) Thank You.
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 13, 2013, 08:54:09 PM
I know i might sound annoying but its just cause i suck at lua (LAWL) can you make something that changes name and text color, sort of like this
[Owner] Greg: Hello.  So if you could make me a lua like this that would be great, i could also pay you if you want ( that's how much i respect you) Thank You.

okay it will be 20 dollars for my next work, Nah JK man. I do all of my things for free, except for any MySQL scripts. Anyways, I do this because of my love for lua, and I used to be like you at one time, and I feel it would be very unfair for my to charge for something like this.

Also so how do you want it...
You want people to change it in the middle of the game(i hope you don't want it like that :( ), or do you want it to be one set color that can't be changed unless you open up the script.
Title: Re: Player Chat Tags
Post by: datgregofag on February 14, 2013, 04:32:27 AM
I want it so you change color when you open the script, and will this script that you will right change the name color AND text to two different colors.or just one color for both name and text. Like my name will be red and what I write will be green, something like that. Thanks for being so kind and helping me out. Bye.
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 14, 2013, 07:55:15 PM
In the script itself, it will tell you wish color you can change.

https://mega.co.nz/#!XA00lZLa!EgHfYjwFXUumS4Mli6abQU9jVzx90D4ZleuiX-F8uUo
Title: Re: Player Chat Tags
Post by: datgregofag on February 15, 2013, 12:11:53 PM
can you make it so that each group has their own name and text color. Hehe
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 15, 2013, 03:47:33 PM
can you make it so that each group has their own name and text color. Hehe

they do have their own name and colour :/

Code: [Select]
{
--Group    --Tag     --Color
{"admin", "ADMIN", Color(0, 0, 255, 255) },
{"superadmin", "SUPERADMIN", Color(255, 0, 0, 255) },
{"owner", "OWNER", Color(0, 255, 0, 255) }
}

just change the Tag and the Colour to what you want it to be.
Title: Re: Player Chat Tags
Post by: datgregofag on February 15, 2013, 08:21:51 PM
Well when i play they have their own rank color but text and name is all the same throughout all ranks.
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 16, 2013, 01:47:54 AM
Well when i play they have their own rank color but text and name is all the same throughout all ranks.

Remember to delete the old addon's, and use the new one I gave you

https://mega.co.nz/#!XA00lZLa!EgHfYjwFXUumS4Mli6abQU9jVzx90D4ZleuiX-F8uUo

You also may want to rename the folder to chat_tags or something like that.
Title: Re: Player Chat Tags
Post by: datgregofag on February 16, 2013, 05:51:31 AM
Here ill show you the problem. Its like this
[Owner] Greg: Hello
then i want it to change text and name color for admin but its still the same except the rank changes color
[Admin] Greg: Hello
See how the RANK only changes color but the text and name stays the same.
i will put my script below and if you can change it so that there is a different name and text color for each group ( except guest). TY Just make it any colors and then ill adjust it.

This is CL TAG lua file.
Code: [Select]
// Cleint Side apple :p

local Tags =
{
--Group    --Tag     --Color
{"admin", "Admin ", Color(220, 180, 0, 255) },
{"superadmin", "Owner ", Color(0, 0, 255, 255) },
{"operator", "Operator ", Color(173, 255, 47, 255) },
{"vip", "VIP ", Color(255, 255, 0, 255) },
{"respected", "Respected ", Color(221, 160, 221, 255) },
{"user", "Guest ", Color(255, 255, 255, 255) }
}

hook.Add("OnPlayerChat", "Tags", function(ply, strText)
for k,v in pairs(Tags) do
if ply:IsPlayer() then
if ply:IsUserGroup(v[1]) then
local nickteam = team.GetColor(ply:Team())
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", Color(255, 255, 0, 255), strText)
return true
end
end
end
end )

The ranks are only for the ranks but how do i add more text and name colors to each group (except guest).
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 16, 2013, 02:14:25 PM
Here ill show you the problem. Its like this
[Owner] Greg: Hello
then i want it to change text and name color for admin but its still the same except the rank changes color
[Admin] Greg: Hello
See how the RANK only changes color but the text and name stays the same.
i will put my script below and if you can change it so that there is a different name and text color for each group ( except guest). TY Just make it any colors and then ill adjust it.

This is CL TAG lua file.
Code: [Select]
// Cleint Side apple :p

local Tags =
{
--Group    --Tag     --Color
{"admin", "Admin ", Color(220, 180, 0, 255) },
{"superadmin", "Owner ", Color(0, 0, 255, 255) },
{"operator", "Operator ", Color(173, 255, 47, 255) },
{"vip", "VIP ", Color(255, 255, 0, 255) },
{"respected", "Respected ", Color(221, 160, 221, 255) },
{"user", "Guest ", Color(255, 255, 255, 255) }
}

hook.Add("OnPlayerChat", "Tags", function(ply, strText)
for k,v in pairs(Tags) do
if ply:IsPlayer() then
if ply:IsUserGroup(v[1]) then
local nickteam = team.GetColor(ply:Team())
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", Color(255, 255, 0, 255), strText)
return true
end
end
end
end )

The ranks are only for the ranks but how do i add more text and name colors to each group (except guest).

I'm really not understanding what is the problem here. You can already do that, look

// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
         chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", Color(255, 255, 0, 255), strText)


What I just colour'd red, is the place you change the text color, and what I colour'd blue is where you can change the name colour.
Title: Re: Player Chat Tags
Post by: datgregofag on February 16, 2013, 03:58:42 PM
Yeah but how do i make each individual rank have their own name and text color.
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 16, 2013, 11:10:51 PM
Yeah but how do i make each individual rank have their own name and text color.

yeah... i have no clue what you mean now... I've helped you on everything...
Title: Re: Player Chat Tags
Post by: datgregofag on February 17, 2013, 04:18:55 PM
Like admins has a rank color of purple a name color red and text color blue
owner has a rank color of red and name color of yellow and text color green
sort of like that except for all my ranks
i have ranks
owner
admin
operator
VIP
respected
user(i dont want any colors for user)
Title: Re: Player Chat Tags
Post by: Bite That Apple on February 17, 2013, 07:40:50 PM
Like admins has a rank color of purple a name color red and text color blue
owner has a rank color of red and name color of yellow and text color green
sort of like that except for all my ranks
i have ranks
owner
admin
operator
VIP
respected
user(i dont want any colors for user)


Like I said, you can. You just need to learn the very basic of lua. It's all right there. Everything is setup for you, you just need to change the color yourself.


// Cleint Side apple :p

local Tags =
{
--Group    --Tag     --Color
{"admin", "Admin ", Color(220, 180, 0, 255), Color(255, 0, 0, 0)  },
{"superadmin", "Owner ", Color(0, 0, 255, 255) , Color(255, 0, 0, 0)  },
{"operator", "Operator ", Color(173, 255, 47, 255), Color(255, 0, 0, 0)  },
{"vip", "VIP ", Color(255, 255, 0, 255), Color(255, 0, 0, 0)  },
{"respected", "Respected ", Color(221, 160, 221, 255), Color(255, 0, 0, 0)  },
{"user", "Guest ", Color(255, 255, 255, 255), Color(255, 0, 0, 0) }
}

hook.Add("OnPlayerChat", "Tags", function(ply, strText)
   for k,v in pairs(Tags) do
      if ply:IsPlayer() then
      if ply:IsUserGroup(v[1]) then
         local nickteam = team.GetColor(ply:Team())
// ----------------------Leave This Alone----------------------------Leave this alone-----------------This will be be Name Colour-------Leave this alone-----------------This is the text colour---------
         chat.AddText(Color(255, 255, 255, 255), "[", v[3], v[2], Color(255, 255, 255, 255), "] ", Color(255, 0, 0, 255), ply:Nick(), Color(255, 255, 255, 255), ": ", v[4], strText)
         return true
      end
      end
   end
end )


Red = Change group color
Green = Change player color
Blue = Change text color




ALSO
I'm sorry, but I can't put it in [ code ] tag. If I do the color disappears.
Title: Re: Player Chat Tags
Post by: TryHardSnipr on March 29, 2013, 07:15:30 PM
Ok, I've got a couple problems here :/

The first is that every time i say something it doubles the chat:
|| { CZG } || TryHardSnipr: .
[Admin On Duty] || { CZG } || TryHardSnipr: .

And the second (which you can see on the second line of the chat) is that i'm using this with darkrp and ulx, and instead of showing the ranks, it shows my job [Admin On Duty] and not [DEVELOPER] like i want it to.

EDIT:
I think I've managed to fix the problem with the jobs/ranks, but im still having problems with the chat doubling itself

EDIT (again):
Do you think you could add darkrp support to this? So for example it works with /ooc and it shows the (OOC) tag, and with team chat, so it shows (TEAM) and of course, stops the double chat :)
Title: Re: Player Chat Tags
Post by: Mors Quaedam on March 30, 2013, 10:12:08 AM
Ok, I've got a couple problems here :/

The first is that every time i say something it doubles the chat:
|| { CZG } || TryHardSnipr: .
[Admin On Duty] || { CZG } || TryHardSnipr: .

And the second (which you can see on the second line of the chat) is that i'm using this with darkrp and ulx, and instead of showing the ranks, it shows my job [Admin On Duty] and not [DEVELOPER] like i want it to.

EDIT:
I think I've managed to fix the problem with the jobs/ranks, but im still having problems with the chat doubling itself

You have to custom code your own chat tag system, like I have with my DarkRP.

(http://puu.sh/2qJGp)
Title: Re: Player Chat Tags
Post by: TryHardSnipr on March 30, 2013, 05:18:16 PM
You have to custom code your own chat tag system, like I have with my DarkRP.

(http://puu.sh/2qJGp)

Would you be so kind as to share your code? :)
i've searched everywhere for a decent, working chat tag addon and not found one,
and i'm not really very experienced in lua, I only know a little bit.
Title: Re: Player Chat Tags
Post by: eagle9er9er on June 24, 2013, 04:29:14 PM
[ERROR] addons/chat_tags/lua/autorun/client/cl_tag.lua:14: '}' expected (to close '{' at line 2) near '{'
  1. unknown - addons/chat_tags/lua/autorun/client/cl_tag.lua:0


I get this as an error, any ideas?


Title: Re: Player Chat Tags
Post by: Bite That Apple on June 24, 2013, 05:33:11 PM
Everyone stop posting on here, I don't look at this at all. Please look at my new thread.
http://forums.ulyssesmod.net/index.php/topic,6196.0.html


[EDIT - JamminR] - Locked, at chaos' [impied[ request. (Let me know in private if you wish this thread to be unlocked)