Version Posted August 22, 2023 Share Posted August 22, 2023 Well, hello, I'm a version. This script deals with how much you unite with the panel so that a player sends him to a base and he stays there when he dies, he continues to stay in his respective Mafia base. Well, the thing is that when I add myself or add to a person to the acl mafia group when that player dies or I myself do not appear in that place where I order him to appear local spawnpoints = { -- pon el grupo aquí y el coords de spawn -- todos el grupos tiene uno o mas spawns -- por ejemplo: -- ["nombre de grupo"] = { { x, y, z, rot }, ... } -- x, y, z = coords -- rot = cual direcion a cara en grados -- NOTA: debes poner el nombre de grupo corecto o no funciona ["Mafia"] = { { 2411.09521, -1766.53259, 13.3, 0 } }, ["Policia"] = { { 0, 0, 4, 0 } }, -- debes no poner ningún grupos bajo grupo "Everyone" ["Everyone"] = { {2481, -1675, 13.4, 0}, {-1972, 879.8, 45.2, 0}, {-703.1, 955.7, 12.3, 0}, {2019, 1543, 10.8, 0}, {-2347, -1593, 496.0, 0} } } function getRandomSpawnPoint(player) local account = getPlayerAccount(player) -- ese jugador tiene cuenta -- buscar la primera grupo el jugador tiene if not isGuestAccount(account) then local accountName = getAccountName(account) for groupName, spawns in pairs(spawnpoints) do -- saltar si grupo no existe local group = aclGetGroup(groupName) if group and isObjectInACLGroup("user."..accountName, group) then local spawns = spawnpoints[groupName] return spawns[math.random(1,#spawns)] end end end -- recurrir a grupo "Everyone" local spawns = spawnpoints["Everyone"] return spawns[math.random(1,#spawns)] end function spawn(player) if not isElement(player) then return end local x, y, z, rot = unpack(getRandomSpawnPoint(player)) spawnPlayer(player, x, y, z, rot, math.random(312)) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end addEventHandler("onPlayerJoin", root, function() spawn(source) end ) addEventHandler("onPlayerWasted", root, function() setTimer(spawn, 1800, 1, source) end ) addEventHandler("onResourceStart", resourceRoot, function() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) Link to comment
DiSaMe Posted August 26, 2023 Share Posted August 26, 2023 I haven't found the cause by reading the script, but I'd recommend adding debug messages using outputChatBox or outputDebugString in various places to check things like variable values and whether the script execution enters if/then/end blocks. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now