sackforever Posted October 14, 2013 Share Posted October 14, 2013 So the login screen of my DayZ server is bugged ,i can login and register but when i login the camera is set to vinewood and the player is not able to spawn could you please help me ? Thank you very much. Link to comment
Arnold-1 Posted October 14, 2013 Share Posted October 14, 2013 Add This local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10 function joinHandler() spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to My Server", source) end addEventHandler("onPlayerLogin", getRootElement(), joinHandler) Change the first x,y,z to the Location you want Link to comment
sackforever Posted October 14, 2013 Author Share Posted October 14, 2013 function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player), "playerID") account = getPlayerAccount(player) local x, y, z = getAccountData(account, "last_x"), getAccountData(account, "last_y"), getAccountData(account, "last_z") local skin = getAccountData(account, "skin") createZombieTable(player) if getAccountData(account, "isDead") then spawnDayZPlayer(player) return end spawnPlayer(player, x, y, z, math.random(0, 360), skin, 0, 0) fadeCamera(player, false) setCameraTarget(player, player) playerCol = createColSphere(x, y, z, 1.5) setElementData(player, "playerCol", playerCol) attachElements(playerCol, player, 0, 0, 0) setElementData(playerCol, "parent", player) setElementData(playerCol, "player", true) for i, data in ipairs(playerDataTable) do local elementData = getAccountData(account, data[1]) if not elementData and data[1] ~= "brokenbone" and data[1] ~= "pain" and data[1] ~= "cold" and data[1] ~= "infection" and data[1] ~= "currentweapon_1" and data[1] ~= "currentweapon_2" and data[1] ~= "currentweapon_3" then if data[1] == "bandit" then else elementData = 0 end end setElementData(player, data[1], elementData) end setElementData(player, "logedin", true) local weapon = getElementData(player, "currentweapon_1") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), true) end local weapon = getElementData(player, "currentweapon_2") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), false) end local weapon = getElementData(player, "currentweapon_3") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), false) end setElementModel(player, getElementData(player, "skin")) setElementData(player, "admin", getAccountData(account, "admin") or false) setElementData(player, "supporter", getAccountData(account, "supporter") or false) triggerClientEvent(player, "onClientPlayerDayZLogin", player) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) Skins = {} Link to comment
sackforever Posted October 14, 2013 Author Share Posted October 14, 2013 Like there is more than one spawn location could i do a math.random without messing the rest of the scripts? I sent a bit of the code there,thanks. Link to comment
sackforever Posted October 14, 2013 Author Share Posted October 14, 2013 You can download the login.lua im trying to fix http://www.mediafire.com/download/wgglyg4wy439f0b/login.lua sorry for the spam and thanks. Link to comment
Arnold-1 Posted October 14, 2013 Share Posted October 14, 2013 i will reply as soon as possible Link to comment
Arnold-1 Posted October 15, 2013 Share Posted October 15, 2013 well i really didn't understand somethings in your script so maybe it's wrong or maybe i am not pro enough to solve this Link to comment
sackforever Posted October 15, 2013 Author Share Posted October 15, 2013 Well thanks at least for trying to help me Link to comment
Moderators Citizen Posted October 15, 2013 Moderators Share Posted October 15, 2013 Well, there is nothing wrong in this code (just some bad copied-pasted instructions that could be in a seperate function to make this code cleaner. There can be 2 possibilities: - Another resource is conflicting with the dayz spawn system. - There is a code client-side that moves the player's camera. Try to check every functions that is "attached" with the event "onClientPlayerDayZLogin". But first try to comment the line 277: triggerClientEvent(player, "onClientPlayerDayZLogin", player) and check if it solves the problem. If it doesn't then there are a lot of chances to be the 1st possibility. 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