So here is the working code...
[code]
local Tags = {}
Tags["superadmin"] = { Color( 255, 0, 119 ), "Owner", Color( 196, 29, 107 ) }
Tags["admin"] = { Color( 0, 136, 255 ), "Admin", Color( 6, 116, 212 ) }
Tags["globaladmin"] = { Color( 227, 39, 39 ), "Global-Admin", Color( 201, 34, 34 ) }
Tags["moderator"] = { Color( 187, 0, 255 ), "Moderator", Color( 153, 0, 209 ) }
Tags["trialmoderator"] = { Color( 149, 76, 176 ), "Trial-Mod", Color( 131, 64, 156 ) }
Tags["staffmanager"] = { Color( 0, 255, 153 ), "S-Manager", Color( 0, 224, 135 ) }
Tags["trusted"] = { Color( 255, 55, 255 ), "Trusted", Color( 188, 40, 255 ) }
Tags["vip"] = { Color( 255, 217, 0 ), "VIP", Color( 232, 197, 0 ) }
Tags["goldvip"] = { Color( 255, 149, 0 ), "GoldVIP", Color( 232, 135, 0 ) }
Tags["diamondvip"] = { Color(0, 229, 255), "DiamondVIP", Color( 0, 204, 227 ) }
Tags["developer"] = { Color(0, 33, 255), "Developer", Color( 255, 0, 0 ) }
local function AddChatTags( ply, msg, team, dead, prefixText, col1, col2 )
if GAMEMODE.FolderName == "darkrp" then
local text = {}
local tag = Tags[ply:GetNWString("usergroup")]
if tag then
table.insert( text, tag[3] )
table.insert( text, " [" )
table.insert( text, tag[1] )
table.insert( text, tag[2] )
table.insert( text, tag[3] )
table.insert( text, "] " )
end
table.insert( text, col1 )
table.insert( text, prefixText )
table.insert( text, col2 )
table.insert( text, ": " .. msg )
chat.AddText( unpack( text ) )
return true
end
end
hook.Add( "OnPlayerChat", "DarkRPChatTags", AddChatTags )
[/code]
Now heres my edit...
[code]
local function AddChatTags( ply, msg, team, dead, prefixText, col1, col2 )
local bktcolor = ply.LMMCTNPCPlayerSpawnBrkColor
local bktleft = LMMCTNPCConfig.BracketLeft
local bktright = LMMCTNPCConfig.BracketRight
local tagcolor = ply.LMMCTNPCPlayerSpawnChatTagColor
local tag = ply.LMMCTNPCPlayerSpawnChatTagText
local plyname = ply:Nick()
local textcolor = Color(255,255,255, 255)
if GAMEMODE.FolderName == "darkrp" then
local text = {}
if ply.LMMCTNPCPlayerSpawnHasTag == true then
tag = {tagcolor, tag, bktcolor}
end
if tag then
table.insert( text, tag[3] )
table.insert( text, " [" )
table.insert( text, tag[1] )
table.insert( text, tag[2] )
table.insert( text, tag[3] )
table.insert( text, "] " )
end
table.insert( text, col1 )
table.insert( text, prefixText )
table.insert( text, col2 )
table.insert( text, ": " .. msg )
chat.AddText( unpack( text ) )
return true
end
end
hook.Add( "OnPlayerChat", "DarkRPChatTags", AddChatTags )
[/code]
Now the player can see his chat tag but no one else can.. with the first snip you can see it for everyone.. please help (ps i may just be tired and missing something thanks!)
is there a server side file?
[QUOTE=gononono64;50793940]is there a server side file?[/QUOTE]
This is in lua/autorun now everything is setup right and it works clientside but the top one shows for everyone and the bottom one does not
[QUOTE=XxLMM13xXx;50792443]So here is the working code...
[code]
local Tags = {}
Tags["superadmin"] = { Color( 255, 0, 119 ), "Owner", Color( 196, 29, 107 ) }
Tags["admin"] = { Color( 0, 136, 255 ), "Admin", Color( 6, 116, 212 ) }
Tags["globaladmin"] = { Color( 227, 39, 39 ), "Global-Admin", Color( 201, 34, 34 ) }
Tags["moderator"] = { Color( 187, 0, 255 ), "Moderator", Color( 153, 0, 209 ) }
Tags["trialmoderator"] = { Color( 149, 76, 176 ), "Trial-Mod", Color( 131, 64, 156 ) }
Tags["staffmanager"] = { Color( 0, 255, 153 ), "S-Manager", Color( 0, 224, 135 ) }
Tags["trusted"] = { Color( 255, 55, 255 ), "Trusted", Color( 188, 40, 255 ) }
Tags["vip"] = { Color( 255, 217, 0 ), "VIP", Color( 232, 197, 0 ) }
Tags["goldvip"] = { Color( 255, 149, 0 ), "GoldVIP", Color( 232, 135, 0 ) }
Tags["diamondvip"] = { Color(0, 229, 255), "DiamondVIP", Color( 0, 204, 227 ) }
Tags["developer"] = { Color(0, 33, 255), "Developer", Color( 255, 0, 0 ) }
local function AddChatTags( ply, msg, team, dead, prefixText, col1, col2 )
if GAMEMODE.FolderName == "darkrp" then
local text = {}
local tag = Tags[ply:GetNWString("usergroup")]
if tag then
table.insert( text, tag[3] )
table.insert( text, " [" )
table.insert( text, tag[1] )
table.insert( text, tag[2] )
table.insert( text, tag[3] )
table.insert( text, "] " )
end
table.insert( text, col1 )
table.insert( text, prefixText )
table.insert( text, col2 )
table.insert( text, ": " .. msg )
chat.AddText( unpack( text ) )
return true
end
end
hook.Add( "OnPlayerChat", "DarkRPChatTags", AddChatTags )
[/code]
Now heres my edit...
[code]
local function AddChatTags( ply, msg, team, dead, prefixText, col1, col2 )
local bktcolor = ply.LMMCTNPCPlayerSpawnBrkColor
local bktleft = LMMCTNPCConfig.BracketLeft
local bktright = LMMCTNPCConfig.BracketRight
local tagcolor = ply.LMMCTNPCPlayerSpawnChatTagColor
local tag = ply.LMMCTNPCPlayerSpawnChatTagText
local plyname = ply:Nick()
local textcolor = Color(255,255,255, 255)
if GAMEMODE.FolderName == "darkrp" then
local text = {}
if ply.LMMCTNPCPlayerSpawnHasTag == true then
tag = {tagcolor, tag, bktcolor}
end
if tag then
table.insert( text, tag[3] )
table.insert( text, " [" )
table.insert( text, tag[1] )
table.insert( text, tag[2] )
table.insert( text, tag[3] )
table.insert( text, "] " )
end
table.insert( text, col1 )
table.insert( text, prefixText )
table.insert( text, col2 )
table.insert( text, ": " .. msg )
chat.AddText( unpack( text ) )
return true
end
end
hook.Add( "OnPlayerChat", "DarkRPChatTags", AddChatTags )
[/code]
Now the player can see his chat tag but no one else can.. with the first snip you can see it for everyone.. please help (ps i may just be tired and missing something thanks!)[/QUOTE]
Why on earth would you need to replace:
[CODE] local tag = Tags[ply:GetNWString("usergroup")] -- this
if ply.LMMCTNPCPlayerSpawnHasTag == true then -- with that?
tag = {tagcolor, tag, bktcolor}
end[/CODE]
[editline]29th July 2016[/editline]
You should just bloody remake DarkRP...
[QUOTE=jacobcooper18;50794029]Why on earth would you need to replace:
[CODE] local tag = Tags[ply:GetNWString("usergroup")] -- this
if ply.LMMCTNPCPlayerSpawnHasTag == true then -- with that?
tag = {tagcolor, tag, bktcolor}
end[/CODE]
[editline]29th July 2016[/editline]
You should just bloody remake DarkRP...[/QUOTE]
What? I
Ok first of all stop. You are doing this in what is possibly the most inefficient way possible. I don't know why you have changed the original code because that works fine and is pretty simple to config. Before you code anything else on this, think "is this actually needed? will people benefit from this? am I creating a solution to a problem that has already been solved? if so, am I doing it better than the existing solution?" People won't use your stuff if you make it worse than existing options, and you as a coder will never improve if you keep shitting up other peoples code.
[QUOTE=meharryp;50794613]Ok first of all stop. You are doing this in what is possibly the most inefficient way possible. I don't know why you have changed the original code because that works fine and is pretty simple to config. Before you code anything else on this, think "is this actually needed? will people benefit from this? am I creating a solution to a problem that has already been solved? if so, am I doing it better than the existing solution?" People won't use your stuff if you make it worse than existing options, and you as a coder will never improve if you keep shitting up other peoples code.[/QUOTE]
This is not going to be a public addon. This is custom and will work fine. I asked for help not for judgement on wether people will want this. Thanks
[QUOTE=XxLMM13xXx;50795362]This is not going to be a public addon. This is custom and will work fine. I asked for help not for judgement on wether people will want this. Thanks[/QUOTE]
I feel sorry for the guy who you're making it for
[QUOTE=meharryp;50795587]I feel sorry for the guy who you're making it for[/QUOTE]
Maybe this is for learning experience maybe you should help instead of being a little ***ch
[highlight](User was banned for this post ("Flaming. Why would you censor this........" - postal))[/highlight]
He helped you. He clearly told you that you are doing unnecessary things, yet you dont listen.
[QUOTE=Gmod4phun;50795761]He helped you. He clearly told you that you are doing unnecessary things, yet you dont listen.[/QUOTE]
How am i doing unnecessary things whats so unnecessary about it?
[QUOTE=XxLMM13xXx;50795866]How am i doing unnecessary things whats so unnecessary about it?[/QUOTE]
It seems that you're remaking the DarkRP tags system. If it works fine why does it need to be changed?
As for why your code doesn't work, can you show us the code where you're setting all the player variables?
[QUOTE=roastchicken;50795925]It seems that you're remaking the DarkRP tags system. If it works fine why does it need to be changed?
As for why your code doesn't work, can you show us the code where you're setting all the player variables?[/QUOTE]
Im not changing any darkrp files??? What darkrp chat tags? We are not running fadmin so its not like that this is standalone
[quote]Im not changing any darkrp files??? What darkrp chat tags? We are not running fadmin so its not like that this is standalone[/quote]
[quote]hook.Add( "OnPlayerChat", "DarkRPChatTags", AddChatTags )[/quote]
"DarkRPChatTags"
Will you now stop with the bullshit please?
[QUOTE=XxLMM13xXx;50795740]Maybe this is for learning experience maybe you should help instead of being a little ***ch[/QUOTE]
Ummmm, why didn't you just drop the word? you using the three stars to cover the letters just means you're the little bitch.
[QUOTE=XxLMM13xXx;50795740]Maybe this is for learning experience maybe you should help instead of being a little ***ch[/QUOTE]
"I am making something way worse than what it is, therefore, that is learning experience, please help me make something shit"
[QUOTE=Gmod4phun;50796004]"DarkRPChatTags"
Will you now stop with the bullshit please?[/QUOTE]
Would that change the way it acts??
[QUOTE=Tupac;50796040]Ummmm, why didn't you just drop the word? you using the three stars to cover the letters just means you're the little bitch.[/QUOTE]
I have gotten banned before so i did not want to risk it
[QUOTE=Mikey Howell;50796131]"I am making something way worse than what it is, therefore, that is learning experience, please help me make something shit"[/QUOTE]
I dont recall saying that but yeah pretty much
[QUOTE=XxLMM13xXx;50795979]Im not changing any darkrp files??? What darkrp chat tags? We are not running fadmin so its not like that this is standalone[/QUOTE]
My bad, I saw 'DarkRP' and assumed it was from DarkRP.
But could you show us the code where you set the player variables (ply.LMMCTNPCPlayerSpawnChatTagText, etc.).
[QUOTE=roastchicken;50796293]My bad, I saw 'DarkRP' and assumed it was from DarkRP.
But could you show us the code where you set the player variables (ply.LMMCTNPCPlayerSpawnChatTagText, etc.).[/QUOTE]
Thats serverside and no i cant show you but those vars are sending correctly thats not the problem the problem is its not broadcasting to everyone
If you cannot show the code then there realy is no point in trying to help you.
[QUOTE=XxLMM13xXx;50796363]Thats serverside and no i cant show you but those vars are sending correctly thats not the problem the problem is its not broadcasting to everyone[/QUOTE]
[QUOTE=XxLMM13xXx;50796363]Thats serverside and no i cant show you but those vars are sending correctly thats not the problem the problem is its not broadcasting to everyone[/QUOTE]
If it isn't broadcasting to everyone then it's quite clear it's [I]not[/I] sending correctly.
[QUOTE=Gmod4phun;50796421]If you cannot show the code then there realy is no point in trying to help you.[/QUOTE]
That code up there is all you should need.
[QUOTE=roastchicken;50796582]If it isn't broadcasting to everyone then it's quite clear it's [I]not[/I] sending correctly.[/QUOTE]
Well the chat sends to everyone... However the tag does not its weird
What's your point for changing it so we can maybe help
[editline]29th July 2016[/editline]
Show us where you are setting the player variables, because it seems like they aren't being set correctly. Not to mention it's silly to store those on the player in this basic sense
[QUOTE=XxLMM13xXx;50796363]Thats serverside and no i cant show you but those vars are sending correctly thats not the problem the problem is its not broadcasting to everyone[/QUOTE]
Player variables don't get sent to the client if you just store them like that. You need to network them. See [url]https://wiki.garrysmod.com/page/Net_Library_Usage[/url]
[QUOTE=XxLMM13xXx;50796363]Thats serverside and no i cant show you but those vars are sending correctly thats not the problem the problem is its not broadcasting to everyone[/QUOTE]
Yeah, I'm sure everyone wants to steal your code.
[QUOTE=crazyscouter;50796750]What's your point for changing it so we can maybe help
[editline]29th July 2016[/editline]
Show us where you are setting the player variables, because it seems like they aren't being set correctly. Not to mention it's silly to store those on the player in this basic sense
Player variables don't get sent to the client if you just store them like that. You need to network them. See [url]https://wiki.garrysmod.com/page/Net_Library_Usage[/url][/QUOTE]
Yes i know well the data is stored in a database and every x sec on the server the database is called and it sends over the data i uses prints and the data is working...
Again.. the problem is that other people cant see my tag..
My screen when i say hi..
[IMG]http://image.prntscr.com/image/272cb28d6f20475a854e2091f7f73244.png[/IMG]
My friends screen when i say hi...
[IMG]http://image.prntscr.com/image/b43e3a139f4145b19c088c568807a438.png[/IMG]
Hard to see but the text is find just the tag does not show
[editline]29th July 2016[/editline]
[QUOTE=meharryp;50796776]Yeah, I'm sure everyone wants to steal your code.[/QUOTE]
you need to stop replying here you are no help thanks
Make sure the data is getting sent to all the players, not just yours. It accesses it on that realm, so it won't be inserted into the table for chat.AddText if the client can't find it.
If you realy are a developer (as your chat tag says), you are not a friendly and a good one. You should start listening to what people are telling you, otherwise you are going to look like a fool.
[QUOTE=Gmod4phun;50796943]If you realy are a developer (as your chat tag says), you are not a friendly and a good one. You should start listening to what people are telling you, otherwise you are going to look like a fool.[/QUOTE]
Whenever this guy makes a post I just see people giving him shit for it. I mean the majority of the responses he was getting were infact pretty rude. If he wants to change something or do it differently let him, don't shit on him for doing it his way. Ya'll need to chill.
[QUOTE=dannyf127;50797052]Whenever this guy makes a post I just see people giving him shit for it. I mean the majority of the responses he was getting were infact pretty rude. If he wants to change something or do it differently let him, don't shit on him for doing it his way. Ya'll need to chill.[/QUOTE]
Well, people are trying to give advice to him, tell him what to do in order to acheive what he wants, but he does not accept the help. He just keeps babbling things that dont make sense, rather than trying to solve his problem. It looks like he is the only one not willing to do it.
[QUOTE=crazyscouter;50796931]Make sure the data is getting sent to all the players, not just yours. It accesses it on that realm, so it won't be inserted into the table for chat.AddText if the client can't find it.[/QUOTE]
BAM there it is i'm not in but I will try it when I get back I just needed another mind that really helped thanks!!! (Unlike everyone else that just bashed me for no reason!
[QUOTE=Gmod4phun;50796943]If you realy are a developer (as your chat tag says), you are not a friendly and a good one. You should start listening to what people are telling you, otherwise you are going to look like a fool.[/QUOTE]
No needed here this does not help me if you wanna talk to me pm me
[QUOTE=dannyf127;50797052]Whenever this guy makes a post I just see people giving him shit for it. I mean the majority of the responses he was getting were infact pretty rude. If he wants to change something or do it differently let him, don't shit on him for doing it his way. Ya'll need to chill.[/QUOTE]
Thanks but still this thread did not need this
[QUOTE=Gmod4phun;50797137]Well, people are trying to give advice to him, tell him what to do in order to acheive what he wants, but he does not accept the help. He just keeps babbling things that dont make sense, rather than trying to solve his problem. It looks like he is the only one not willing to do it.[/QUOTE]
No one was helping st me just yelling when they did not even know what I was trying to do
Sorry, you need to Log In to post a reply to this thread.