> For the complete documentation index, see [llms.txt](https://patamods.gitbook.io/patamods-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://patamods.gitbook.io/patamods-documentation/scripts/plasmagame-and-capture-the-orb-dlc/3-advanced-configuration.md).

# 3・Advanced configuration

<figure><img src="/files/ZagSg93fa3JaU0DsAkM9" alt=""><figcaption></figcaption></figure>

## ![:1arrowpink:](https://cdn.discordapp.com/emojis/1048588915277307934.gif?size=44\&quality=lossless) This topic concern people who know what they do and want to add payment / restriction.

* in `PlasmaLobby\unencrypted\serverSpec`, you can add your Framework to make your players paid or any restrictions as you want when they create and join a lobby.

{% code fullWidth="true" %}

```lua
--You can add here any restriction to create a game (Job / Vip or what ever)
RegisterServerEvent('PlasmaLobby:AskForCreateAGame')
AddEventHandler('PlasmaLobby:AskForCreateAGame', function(data)
	local player = source
	print("---creatorname : "..tostring(data.creatorname))
	for k,v in pairs(data) do
		print(tostring(k).." : "..tostring(v))
	end
	print("---")
	
	local curIDX = #allPlasmaSession + 1 
	if data.mode == "Team DeathMatch" then
		allPlasmaSession[curIDX] = {}
		allPlasmaSession[curIDX].lobbyname = "Game-"..tostring(IDX)
		TriggerEvent("PaintBall:NewSession",data,curIDX,player)
	elseif data.mode == "Capture The Orbs" then
		allPlasmaSession[curIDX] = {}
		allPlasmaSession[curIDX].lobbyname = "Game-"..tostring(IDX)
		TriggerEvent("PaintBall:NewCTFSession",data,curIDX,player)
	elseif data.mode == "Burning Mode" then
		allPlasmaSession[curIDX] = {}
		allPlasmaSession[curIDX].lobbyname = "Game-"..tostring(IDX)
		TriggerEvent("PlasmaBurning:NewSession",data,curIDX,player)
	elseif data.mode == "Random Weapon" then
		allPlasmaSession[curIDX] = {}
		allPlasmaSession[curIDX].lobbyname = "Game-"..tostring(IDX)
		TriggerEvent("PlasmaRandom:NewSession",data,curIDX,player)
	end
end)

--You can add here any restriction to create a game (ticket / Vip or what ever)
RegisterServerEvent('PlasmaLobby:TryToJoinAGame')
AddEventHandler('PlasmaLobby:TryToJoinAGame', function(IDX,side)
	-- print("RWM Lobby Status received")
	-- Wait(30)
	local player = source
	local gameDetails = {}
	local isOwner = false
	-- if RequestAllLobby() then
		-- concatAllLobby()
	print("k,v in pairs(allPlasmaSession)")
	print("Lobby With Exclusion == "..tostring(IsPlayerAlreadyInALobby(player,IDX)))
	print("Lobby Without Exclusion == "..tostring(IsPlayerAlreadyInALobby(player)))
	
	if not IsPlayerAlreadyInALobby(player,IDX) then
		for k,v in pairs(allPlasmaSession) do
			for k1,v1 in pairs(v) do
			print("^1k,v:"..tostring(k1)..","..tostring(v1).."^7")
			end
			if tostring(v.idx) == tostring(IDX) then
			
				if v.CurStat == "WaitingPeople" then
					if v.modes == "Team DeathMatch" then
					print("status : "..tostring(v.CurStat))
						
						if side =="blue" then
							TriggerEvent("PaintBall:JoinBlue",IDX,player,GetSpecificPlayerName(player))
						elseif side =="red" then
							TriggerEvent("PaintBall:JoinRed",IDX,player,GetSpecificPlayerName(player))
						end
						
						
					elseif v.modes == "Capture The Orbs" then
						if side =="blue" then
							TriggerEvent("PaintBallCTF:JoinBlue",IDX,player,GetSpecificPlayerName(player))
						elseif side =="red" then
							TriggerEvent("PaintBallCTF:JoinRed",IDX,player,GetSpecificPlayerName(player))
						end
					elseif v.modes == "Random Weapon" then
						if side =="blue" then
							TriggerEvent("PlasmaRandom:JoinBlue",IDX,player,GetSpecificPlayerName(player))
						elseif side =="red" then
							TriggerEvent("PlasmaRandom:JoinRed",IDX,player,GetSpecificPlayerName(player))
						end
					
					
					elseif v.modes == "Burning Mode" then
						if side =="blue" then
							TriggerEvent("PlasmaBurn:JoinBlue",IDX,player,GetSpecificPlayerName(player))
						elseif side =="red" then
							TriggerEvent("PlasmaBurn:JoinRed",IDX,player,GetSpecificPlayerName(player))
						end
					end
				else
					TriggerClientEvent("PlasmaLobby:Notif",player,trad[lang]["AlreadyInALobby"],"error")
				end
				break; --Break car game found
			end
		end
	else
		TriggerClientEvent("PlasmaLobby:Notif",player,trad[lang]["AlreadyInALobby"],"error")
	end
	-- else
		-- print("error on getting lobby")
	-- end
end)
```

{% endcode %}

* In `PlasmaLobby\unencrypted\serverFunc`, you can enable our debug (server side) in case you need it.

{% code fullWidth="true" %}

```lua
DEBUG = false
ENABLECOMMAND = false



aff = print
function print(text)
	if DEBUG then
		aff(text)
	end
end

function GetSpecificPlayerName(player)
	local name = ""
	name = GetPlayerName(player)
	return name
end
```

{% endcode %}

* You don't need to make any change in `PlasmaLobby\unencrypted\clientSpec.`\
  (It's about detection of start/end, of the current weapon...)\
  Please, don't touch at this part.

In `PlasmaLobby\unencrypted\clientFunc`, you can modify the notification system (+ enable the debug client side).

{% code fullWidth="true" %}

```lua
DEBUG = false
ENABLECOMMAND = false



aff = print
function print(text)
	if DEBUG then
		aff(text)
	end
end


-- You can modify this to use your own Notification system
function notification(msg,typeOfNotif)
	if typeOfNotif == "success" then
		SetNotificationTextEntry("STRING")
		AddTextComponentString("~g~"..msg)
		DrawNotification(true, false)
		
	elseif typeOfNotif == "info" then
		SetNotificationTextEntry("STRING")
		AddTextComponentString(msg)
		DrawNotification(true, false)
		
	elseif typeOfNotif == "error" then
		SetNotificationTextEntry("STRING")
		AddTextComponentString("~r~"..msg)
		DrawNotification(true, false)
	end
end

-- You can modify this to use your own Notification system
function UPPERnotification(msg)
	SetTextComponentFormat("STRING")
    AddTextComponentString(msg)
    DisplayHelpTextFromStringLabel(0, 0, 1, -1)
end
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://patamods.gitbook.io/patamods-documentation/scripts/plasmagame-and-capture-the-orb-dlc/3-advanced-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
