DarkRP:Group Chat

From DarkRP
Jump to navigation Jump to search
DarkRP: Group Chat
Page white text.png Description:How to create your very own group chats as well as edit the default ones.
User.png Original Author:Drakehawke & Bo98
Table edit.png Updated:13th May 2013 (rewrite), 5th October 2013 (DarkRP 2.5.0)
This page is available in the following languages:
Данная версия страницы доступна на следующих языках:
Jarvis-flag 8010.png English | France-flag.png Français

Here I'm going to show you how you can create your own group chats, or add jobs to the current ones.

Go to lua/darkrp_customthings/groupchats.lua (see here), and you will find something similar to this:

Group chats
Team chat for when you have a certain job.
e.g. with the default police group chat, police officers, chiefs and mayors can
talk to one another through /g or team chat.

Simple method:
GAMEMODE:AddGroupChat(List of team variables separated by comma)

Advanced method:
GAMEMODE:AddGroupChat(a function with ply as argument that returns whether a random player is in one chat group)
This is for people who know how to script Lua.
-- Example: GAMEMODE:AddGroupChat(TEAM_MOB, TEAM_GANG)
-- Example: GAMEMODE:AddGroupChat(function(ply) return ply:isCP() end)

This is the file we're going to be working with.

Editing the current group chats:[edit]

Group chats can be set up using a function or with team names.

Let's say we want to add our custom team, TEAM_SWAT to the police group chat. The police chat is not a list of teams but a function returning true if the player is a CP. To add TEAM_SWAT to this chat, we need to set the team as a CP team. This page will tell you how you can do so.

Now let's say we want to add another custom team, TEAM_THIEF to the gang group chat. This time it is simply a list of teams so we can simply add TEAM_THIEF by adding this:


and disabling the default in lua/darkrp_config/disabled_defaults.lua:

DarkRP.disabledDefaults["groupchat"] = {
	[1] = false, -- Police group chat (mayor, cp, chief and/or your custom CP teams)
	[2] = true, -- Group chat between gangsters and the mobboss


To create your own group chat:[edit]

To add your own group chat, use the template below:


Here I have set up a third group chat for hobos:


And here I have set up a fourth group chat for cooks and gun dealers: