Search the Community
Showing results for tags 'teamspawn'.
-
Hi buddies , We tried to set team spawn but we can't make it. We writed some codes. Where did we do wrong ? If you help me, I feel be happy. Thanks for reading... local spawnpoint addEventHandler("onResourceStart", resourceRoot, function() spawnpoint = getRandomSpawnPoint() resetMapInfo() for i,player in ipairs(getElementsByType("player")) do spawn(player) end end ) function spawn(player) --if not isElement(player) then return end if get("spawnreset") == "onSpawn" then spawnpoint = getRandomSpawnPoint() end exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false) repeat until setElementModel(player,math.random(312)) fadeCamera(player, true) setCameraTarget(player, player) showChat(player, true) end function getRandomSpawnPoint () local spawnpoints = getElementsByType("spawnpoint") return spawnpoints[math.random(1,#spawnpoints)] end addEventHandler("onPlayerJoin", root, --oyuncu servera girdiğinde function() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("**^HYDRA^**")) then --eğer oyuncu **^HYDRA^** grubunda ise setTimer(spawnPlayer, 2000, 1, source, 1437.5341796875, 734.0068359375, 10.8203125) --oyuncuyu burda spawnla else spawn(source) end end) addEventHandler("onPlayerLogin", root, --oyuncu hesabına giriş yaptığında function() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("**^HYDRA^**")) then --eğer oyuncu **^HYDRA^** grubunda ise setTimer(spawnPlayer, 2000, 1, source, 1437.5341796875, 734.0068359375, 10.8203125) --oyuncuyu burda spawnla end end) addEventHandler("onPlayerQuit",root, function () if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then spawnpoint = getRandomSpawnPoint() end end ) addEventHandler("onPlayerWasted", root, -- oyuncu öldüğünde function() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("**^HYDRA^**")) then --eğer oyuncu **^HYDRA^** grubunda ise setTimer(spawnPlayer, 2000, 1, source, 1448.7550048828, 708.31512451172, 10.8203125) --oyuncuyu burda spawnla else setTimer(spawn, 2000, 1, source) end end)