CHEF491 Posted August 19, 2017 Share Posted August 19, 2017 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) Link to comment
John Smith Posted August 19, 2017 Share Posted August 19, 2017 Hello. It would help us to help with your issue, if you would put that code in a code box which this text editor on this forum offers, you click on it, and it looks like < > It's easier to look the code when it's inside that code box as it makes it look better to diagnose. Also, use /debugscript 3 and tell us if you have any errors there when you start the resource. (/debugscript 3 info is also essential in helping us to help you with your problem when asking about script fixes) Link to comment
External Posted August 20, 2017 Share Posted August 20, 2017 get("spawnreset") ?? did you create a function called get? Link to comment
Moderators IIYAMA Posted August 20, 2017 Moderators Share Posted August 20, 2017 @External if you click on 'get', then you will see that it is a MTA function. @CHEF491 Pls read the guidelines of @Dutchman101 before posting. Link to comment
Storm-Hanma Posted October 6, 2017 Share Posted October 6, 2017 https://community.multitheftauto.com/index.php?p=resources&s=details&id=14810 This will help you made by me 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