SkyDow Posted October 24, 2019 Share Posted October 24, 2019 Hi all ! I have a problem !?! I have a DayZ MTA server and when I log in I randomly teleport and spam me with Account has been reset! I use the MTA DayZ 0.7r3 gamemode ! can i change this script with another one? that when I go to another login panel I get a black screen! look here for some pictures that randomly spawn me and spam me at Account is Buggy has been reset! Photos: https://imgur.com/a/hEfCFXa please help me well i am a beginner in scripting and i need help !!! (Don't hate that you were like me too and you were scripting and asking for help) function checkBuggedAccont(player) if isElement(player) then if not isGuestAccount(getPlayerAccount(player)) then if getElementData(player, "logedin") then if (getElementModel(player) == 0) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); return; end for _,v in ipairs(playerDataTable) do if (type(getElementData(player, v[1])) ~= type(v[2])) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); end end end end end end addCommandHandler("kill", function(player) triggerEvent("kilLDayZPlayer", player); end); Link to comment
Addlibs Posted October 25, 2019 Share Posted October 25, 2019 It appears your login panel spawns players in skin 0 (CJ) which is what DayZ uses to detect if an account is glitched. You should let DayZ handle the spawning while your login panel only logs the player in and sets his element data "logedin" (sic) to true Link to comment
SkyDow Posted October 25, 2019 Author Share Posted October 25, 2019 3 minutes ago, MrTasty said: It appears your login panel spawns players in skin 0 (CJ) which is what DayZ uses to detect if an account is glitched. You should let DayZ handle the spawning while your login panel only logs the player in and sets his element data "logedin" (sic) to true What ?! im need function for repairing problem ?!!! Link to comment
Moderators IIYAMA Posted October 26, 2019 Moderators Share Posted October 26, 2019 20 hours ago, SparkySky said: What ?! im need function for repairing problem ?!!! If you do not understand the problem yet, how do you know that you need a function for repair? I understand that you are a new scripter, but not understanding the nature of the function you are trying to fix is not handy. The function is used to detect bugged accounts. Fix therefore the issue rather than the function that checks if issues occur. Link to comment
Tekken Posted October 26, 2019 Share Posted October 26, 2019 Delete the for loop I think you have an outdated version. This part of the code: for _,v in ipairs(playerDataTable) do if (type(getElementData(player, v[1])) ~= type(v[2])) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); end end Also just to ensure that everything is right delete internal.db Link to comment
SkyDow Posted October 27, 2019 Author Share Posted October 27, 2019 22 hours ago, Tekken said: Delete the for loop I think you have an outdated version. This part of the code: for _,v in ipairs(playerDataTable) do if (type(getElementData(player, v[1])) ~= type(v[2])) then removeBackpack(player); removeWeaponBack(player); removeWeaponBack2(player); removeWeaponReplace(player); spawnDayZPlayer(player); outputChatBox(getPlayerName(player).."'s account is buggy and has been reset.", getRootElement(), 25, 255, 25); end end Also just to ensure that everything is right delete internal.db I did as you said, but another problem appeared to me! That's when I logged on to the server! Here's a picture: https://imgur.com/a/oAJvIYZ Link to comment
Scripting Moderators ds1-e Posted October 27, 2019 Scripting Moderators Share Posted October 27, 2019 1 hour ago, SparkySky said: I did as you said, but another problem appeared to me! That's when I logged on to the server! Here's a picture: https://imgur.com/a/oAJvIYZ Type /debugscript 3 Without that you can't go any further. It will display scripts warning/errors. Link to comment
SkyDow Posted October 27, 2019 Author Share Posted October 27, 2019 (edited) 9 minutes ago, majqq said: Type /debugscript 3 Without that you can't go any further. It will display scripts warning/errors. in /debugscript 3 I show no error everything is clean neither warnings nor errors ! look does not show me any error or warning, only the admin appears and so much! https://imgur.com/a/daD2ISn Edited October 27, 2019 by SparkySky Link to comment
SkyDow Posted October 28, 2019 Author Share Posted October 28, 2019 Hi all ! I found the problem so it does not spawn me and just shows me the interface from the 51st! I don't know if this function works correctly! Maybe someone can help me figure it out! addEvent("onPlayerDayZRegister", true); addEvent("onPlayerDayZLogin", true); addEvent("kilLDayZPlayer", true); addEventHandler("onPlayerDayZLogin", root, function(player) local account = getPlayerAccount(player); local x,y,z = getAccountData(account, "last_x"), getAccountData(account, "last_y"), getAccountData(account, "last_z"); local skin = getAccountData(account, "skin"); if getAccountData(account, "isDead") then return spawnDayZPlayer(player); end spawnPlayer(player, x, y, (z+2), math.random(360), skin, 0, 0); fadeCamera(player, true); setCameraTarget(player, player); local 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 _,v in ipairs(playerDataTable) do setElementData(player, v[1], getAccountData(account, v[1])); end setElementData(player, "logedin", true); setElementModel(player, getElementData(player, "skin")); setTimer(checkBuggedAccont, (25*1000), 1, player); setElementData(player, "spawnedzombies", 0); equipThem(player, 0); end); addEventHandler("onPlayerDayZRegister", getRootElement(), function(player) spawnDayZPlayer(player); setElementData(player, "radiochannel", "99999"); setElementData(player, "gpschannel", ""); setElementData(player, "gang", "None"); savePlayerData(player); end); function spawnDayZPlayer(player) if player then local x,y,z = unpack(spawnPositions[math.random(#spawnPositions)]); spawnPlayer(player, x, y, (z+0.5), math.random(360), 73, 0, 0); setCameraTarget(player, player); fadeCamera(player, true); local 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); setAccountData(getPlayerAccount(player), "isDead", false); setElementData(player, "isDead", false); setElementData(player, "logedin", true); for _,v in ipairs(playerDataTable) do if (v[1] ~= "radiochannel" and v[1] ~= "gpschannel") then setElementData(player, v[1], v[2]); end end setElementData(player, "logedin", true); setTimer(checkBuggedAccont, (25*1000), 1, player); setElementData(player, "spawnedzombies", 0); end end 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