25 lines
742 B
Lua
25 lines
742 B
Lua
-- server/gang_sync.lua
|
|
print("^2[turfwar]^7 gang_sync.lua loaded")
|
|
|
|
-- IMPORTANT: set this to match wherever you store gang membership.
|
|
-- Most turfwar scripts have something like PlayerGang[src] = gangId
|
|
-- If yours is named differently, change it here.
|
|
local function getGangFor(src)
|
|
if PlayerGang and PlayerGang[src] ~= nil then
|
|
return tonumber(PlayerGang[src]) or 0
|
|
end
|
|
|
|
-- Common alternates people use:
|
|
if GangOf and GangOf[src] ~= nil then
|
|
return tonumber(GangOf[src]) or 0
|
|
end
|
|
|
|
return 0
|
|
end
|
|
|
|
RegisterNetEvent("turfwar:gang:requestMyGang", function()
|
|
local src = source
|
|
local gangId = getGangFor(src)
|
|
TriggerClientEvent("turfwar:setMyGang", src, gangId)
|
|
end)
|