PataMods Documentation
  • Welcome to PataMods Doc !
    • 1️⃣First step
    • 💬Social Medias
    • ❗・Common errors・❗
  • 📖Scripts
    • 🛒SuperMarket
      • 1・Dependencies
      • 2・Installation
      • 3・Config
      • 4・Advanced configuration / Custom Framework
      • 5・How the SuperMarket Script works INGAME ? - ❗ HELP VIDEOS ❗
    • 🔫PlasmaGame (And Capture The Orb DLC)
      • 1・Installation & Dependecies
      • 2・Config
      • 3・Advanced configuration
      • 4・Common errors + About Guns
    • 🏎️PlasmaKart
      • 1・Installation & Dependecies
      • 2・Config
      • 3・Common errors
    • ✈️Airplane Script
      • 1・Dependencies
      • 2・Installation
      • 3・Config
      • 4・Advanced Configuration
      • 5・How to add point on UI map ?
      • 6・❗ About BUGS ❗ Airplane flying in circle, Airplane/ped didn't spawn etc
    • 🛼Roller & Ice Script
      • 1・Installation
      • 2・Config
    • 🍼Baby BEAR Script v2
      • 0・About FiveM's ToS
      • 1・Installation & Dependecies
      • 2・How it works + Baby Nursery/toddler props
    • 🌊Hottub Script
      • 1・Dependencies
      • 2・Installation
      • 3・Config
    • 📦Props/shells config for Housing Scripts
    • 🔃 Subscription
      • 1・Wedding Clothes package
      • 2・Screenshots & video texture
  • 🛠️Website in construction...
    • 🛵PlasmaTron
    • 🚗Rc Car Script
  • Tebex Store
Powered by GitBook
On this page
  1. Scripts
  2. PlasmaGame (And Capture The Orb DLC)

3・Advanced configuration

Previous2・ConfigNext4・Common errors + About Guns

Last updated 1 year ago

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.

--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)

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

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

  • 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).

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
📖
🔫
:1arrowpink:
Page cover image