General > Developers Corner

Need help with coding

<< < (6/6)

Aaron113:

--- Quote from: Janjakob2000 on July 04, 2015, 04:26:47 AM ---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.
--- End quote ---
You wouldn't change the group check, you would add groups to the table.  You would want to change the "superadmin" in hsv_tags to premium.


--- Quote from: Janjakob2000 on July 04, 2015, 04:26:47 AM ---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?
--- End quote ---
Do you mean group as in another style of chat tag?  or just adding another group to the hsv tags?

Janjakob2000:

--- Quote from: Aaron113 on July 04, 2015, 02:55:23 PM ---You wouldn't change the group check, you would add groups to the table.  You would want to change the "superadmin" in hsv_tags to premium.
Do you mean group as in another style of chat tag?  or just adding another group to the hsv tags?

--- End quote ---

"You wouldn't change the group check, you would add groups to the table.  You would want to change the "superadmin" in hsv_tags to premium."

Can you explain me how that would work then?

Also, I just want another chat tag, for staff ranks such as superadmin, admin, owner ect., just like the normal addon provides that, the apple_chat_manage_tags one, but then in your format like you provided before.

Janjakob2000:

--- Quote from: Aaron113 on July 04, 2015, 02:55:23 PM ---You wouldn't change the group check, you would add groups to the table.  You would want to change the "superadmin" in hsv_tags to premium.
Do you mean group as in another style of chat tag?  or just adding another group to the hsv tags?

--- End quote ---
It really has been a while, I've tryed to learn lua, I've came far, but I still don't know how to do this, can you maybe like explain me what to do, because I don't know what I have to do...

Aaron113:
Do you understand what a table is?  Perhaps you should read up on it or experiment with it.

You add your hsv tag groups to the hsv_tags table and it automatically does it for you.  If you want to apply some other type of effect, you need to add an elseif check behind my first if check.

Navigation

[0] Message Index

[*] Previous page

Go to full version