General > Developers Corner
Need help with coding
Janjakob2000:
--- Quote from: JamminR on July 02, 2015, 10:11:47 AM ---Experiment. Look at the code. There are bits in it that relate to checking a group.
Make a copy of the file, put it somewhere that if you break it you can put the working copy back.
Then try moving the portion that you think looks like a group check in front of the portion that is where you want it.
So far, few of the questions I've seen you ask are 'help me learn' question as much as they are 'tell me what to do by doing it for me'.
Not to say that's not allowed here, but it's misleading with your topic title.
--- End quote ---
What I was meaning to say is, in what directory do I put these codes, do I put it in addons/apple_chat_manage_tags/cl_chattags
or do I create for both a seperate file?
e.g.:
addons/apple_chat_manage_tags/newfile.lua
which has the second code of what Aaron made.
I know how to code, but I'm bad at directorys and where to put files at.
Aaron113:
--- Quote from: Janjakob2000 on July 02, 2015, 11:13:24 AM ---What I was meaning to say is, in what directory do I put these codes, do I put it in addons/apple_chat_manage_tags/cl_chattags
or do I create for both a seperate file?
e.g.:
addons/apple_chat_manage_tags/newfile.lua
which has the second code of what Aaron made.
I know how to code, but I'm bad at directorys and where to put files at.
--- End quote ---
All you do is replace the original file. You shouldn't have to change anything except the contents of that file you first mentioned.
EDIT: I just switched everything over to my other hard drive (I think my SSD is failing), if you still need help I can do it tomorrow.
Janjakob2000:
--- Quote from: Aaron113 on July 02, 2015, 10:21:51 PM ---All you do is replace the original file. You shouldn't have to change anything except the contents of that file you first mentioned.
EDIT: I just switched everything over to my other hard drive (I think my SSD is failing), if you still need help I can do it tomorrow.
--- End quote ---
I would really appreciate it if you would make it the tag along with the username rainbow.
(Like stated above)
Aaron113:
--- Quote from: Janjakob2000 on July 02, 2015, 11:45:38 PM ---I would really appreciate it if you would make it the tag along with the username rainbow.
(Like stated above)
--- End quote ---
I'll let you figure out how to incorporate it into my code so you're at least trying to do something.
--- Code: --- if table.HasValue(hsv_tags, ply:GetUserGroup()) then
table.insert(addchat, "<hsv>".. teamnick .."</hsv>")
table.insert(addchat, Color(50, 50, 50, 255))
table.insert(addchat, "| ")
table.insert(addchat, "<hsv>"..ply:Nick() .."</hsv>")
else
table.insert(addchat, teamcolor)
table.insert(addchat, teamnick)
table.insert(addchat, Color(50, 50, 50, 255))
table.insert(addchat, "| ")
table.insert(addchat, teamcolor)
table.insert(addchat, ply:Nick())
end
--- End code ---
Janjakob2000:
--- Quote from: Aaron113 on July 03, 2015, 08:53:25 AM ---I'll let you figure out how to incorporate it into my code so you're at least trying to do something.
--- Code: --- if table.HasValue(hsv_tags, ply:GetUserGroup()) then
table.insert(addchat, "<hsv>".. teamnick .."</hsv>")
table.insert(addchat, Color(50, 50, 50, 255))
table.insert(addchat, "| ")
table.insert(addchat, "<hsv>"..ply:Nick() .."</hsv>")
else
table.insert(addchat, teamcolor)
table.insert(addchat, teamnick)
table.insert(addchat, Color(50, 50, 50, 255))
table.insert(addchat, "| ")
table.insert(addchat, teamcolor)
table.insert(addchat, ply:Nick())
end
--- End code ---
--- End quote ---
Basically, if I add "premium" at line 1 near IsUserGroup(), it would check for the group premium, and make the teamnick, so I think the tag the user has, which in this case is [Premium] , will be rainbow colored along with ..ply:Nick() ..
If the player isn't premium (else at line 6), they will just keep their regular name, without any rainbow because they are not in the premium group.
Now, if I'm correct, I should place this code into my cl_chat_apple_tag.lua file, located at addons/apple_manage_chat_tags/lua/autorun
but I have 1 problem, if I want to create another group, do I just create another if table.HasValue below this code and do the same thing over, but then instead remove hsv_tags and remove the <hsv></hsv>, or not?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version