API

isCuffed (server)

-- returns true or false
local isCuffed = exports['uniq_gang']:isCuffed(source)
print(isCuffed)

isGang (server)

-- returns true or false
local isgang = exports['uniq_gang']:isGang(source)
print(isgang)

GetGangLevel (server)

local level = exports['uniq_gang']:GetGangLevel('uniq')
print(level)

DoesGangExist (server)

local gang = exports['uniq_gang']:DoesGangExist('uniq')

if gang then
    print(json.encode(gang, {indent = true}))
end

AddGangMoney (server)

RegisterCommand('test', function(source, args, raw)
	local name = args[1]
	local amount = tonumber(2)

	if name then
		local gang = exports['uniq_gang']:DoesGangExist(name)

		if gang then
			exports['uniq_gang']:AddGangMoney(gang.name, amount)
		end
	end
end)

RemoveGangMoney (server)

RegisterCommand('test', function(source, args, raw)
	local name = args[1]
	local amount = tonumber(2)

	if name then
		local gang = exports['uniq_gang']:DoesGangExist(name)

		if gang then
			exports['uniq_gang']:RemoveGangMoney(gang.name, amount)
		end
	end
end)

SetGangMoney (server)

RegisterCommand('test', function(source, args, raw)
	local name = args[1]
	local amount = tonumber(2)

	if name then
		local gang = exports['uniq_gang']:DoesGangExist(name)

		if gang then
			exports['uniq_gang']:SetGangMoney(gang.name, amount)
		end
	end
end)

SetGangLevel (server)

-- min 1
-- max 4
RegisterCommand('test', function(source, args, raw)
	local name = args[1]
	
	if name then
		local gang = exports['uniq_gang']:DoesGangExist(name)

		if gang then
			exports['uniq_gang']:SetGangLevel(gang.name, 1)
		end
	end
end)

GetGang (client)

RegisterCommand('GetGang', function(source, args, raw)
    print(json.encode(exports.uniq_gang:GetGang(), { indent = true }))
end)

GetGang(server)

RegisterCommand('GetGang', function(source, args, raw)
    print(json.encode(exports.uniq_gang:GetGang(source), { indent = true }))
end)

GetGangMoney (server)

exports.uniq_gang:GetGangMoney('uniq')

Last updated