Leaderboard
Popular Content
Showing content with the highest reputation on 29/08/23 in all areas
-
About Prime Freeroam is an advanced Freeroam server with roleplay features! It has been in development since 2017. If you find any bugs please report them on our discord. Server IP: mtasa://149.28.237.162:22003 Discord: https://discord.gg/Xz9NUAq NPC features We have an extensive NPC system that is fully synchronised and includes features such as: A wanted system with more and harder law enforcement spawning in the greater your wanted level. Traffic - pedestrians, cars and boats. You will find special pedestrians around the map - some easter eggs! Restricted areas such as Area 51 have military, hidden secrets and also tanks (For all your rampage needs!). And much more! Shops and minigames You can spend your money at all the shops in GTA SA Ammunation, Food shops, Hardware store and Strip clubs - and a few more! Time trials, drift challenges and races are located around the map. Taxi, Pizza and Trucking missions to earn money. Casino games including pool where you can compete against other players. Gangs You can join the classic gangs from GTA SA or create your own crew. You can recruit and spawn followers to command. You can even do drivebys! Take gang territories by attacking peds or players in their zone to initiate a gang war. You will have to hold the hill while fighting off waves of enemies. Freeroam To explore you can warp around the map, and spawn vehicles and customise them. We have synchronised vehicle radio, jukeboxes and ped sounds! Media https://streamable.com/tlf8ye1 point
-
Hey guys, I know this code is a mess, I've been messing around with it trying to get it to work but its not 100% working What does not work: - When player leaves the server its not saving his new "combattime" AccountData value to db (which if he was in combat mode when he left, it should be 1 when he logs back in, but its always 0) Appreciate any help server function spawn() setTimer(function(source) outputChatBox("This server is protected by BattlDayZ (V1.1), an anticheat system.",source,255,0,0) end,2000,1,source) local playerAccount = getPlayerAccount(source) if getAccountData(playerAccount,"combattime") == 1 then setTimer ( killhim, 7000, 1,source) end end addEventHandler("onPlayerLogin",root,spawn) function killhim(source) outputChatBox("you got killed for disconnecting during a fight!") exports.DayZ:setPlayerBlood(source,-5) setTimer(function(source) setAccountData(source,"combattime",0) end,5000,1,source) end function setAccount1(source) local playerAccount = getPlayerAccount(source) setAccountData(playerAccount,"combattime",1) end addEventHandler("setAccount1", root, setAccount1) addEvent("setAccount1", true) function setAccount2(source) local playerAccount = getPlayerAccount(source) setAccountData(playerAccount,"combattime",0) end addEventHandler("setAccount2", root, setAccount2) addEvent("setAccount2", true) function getAccount(source) local playerAccount = getPlayerAccount(source) getter = getAccountData(playerAccount,"combattime") end addEventHandler("getAccount", root, getAccount) addEvent("getAccount", true) client combatloglabel = guiCreateLabel(0.82, 0.00, 0.27, 0.04, "A", true) guiSetVisible(combatloglabel,false) function createLogLabel() guiSetVisible(combatloglabel,true) guiLabelSetColor(combatloglabel, 17, 249, 5) guiLabelSetHorizontalAlign(combatloglabel, "center", false) guiLabelSetVerticalAlign(combatloglabel, "center") guiSetText(combatloglabel,"[Out of combat]") end addEventHandler("onClientPlayerSpawn",localPlayer,createLogLabel) function onPlayerActivateCombatLog(attacker) triggerServerEvent("getAccount", source) outputChatBox("getAccount OK") if getter == 0 then guiSetText(combatloglabel,"[Out of combat]") guiLabelSetColor(combatloglabel,0,255,0) outputChatBox("getter == 0") else guiSetText(combatloglabel,"[In combat]\nDont disconnect or you will die") guiLabelSetColor(combatloglabel,255,0,0) outputChatBox("getter == 1") end setTimer(function(source) outputChatBox("timer") triggerServerEvent("setAccount2", source) end,10000,1,source) end addEventHandler("onClientPlayerDamage",root,onPlayerActivateCombatLog)1 point
-
function spawn() setTimer(function(source) outputChatBox("This server is protected by BattlDayZ (V1.1), an anticheat system.",source,255,0,0) end,2000,1,source) local playerAccount = getPlayerAccount(source) if getAccountData(playerAccount,"combattime") == 1 then setTimer ( killhim, 7000, 1,source) else setElementData(source,"combattime",getAccountData(playerAccount,"combattime") or 0) end end addEventHandler("onPlayerLogin",root,spawn) function killhim(source) outputChatBox("you got killed for disconnecting during a fight!") -- exports.DayZ:setPlayerBlood(source,-5) setTimer(function(source) setElementData(source,"combattime",0) end,5000,1,source) end addEvent("setAccount1",true) function setAccount1() if client then setElementData(client,"combattime",1) end end addEventHandler("setAccount1", root, setAccount1) addEvent("setAccount2", true) function setAccount2() if client then setElementData(client,"combattime",0) end end addEventHandler("setAccount2", root, setAccount2) function saveData() local a = getPlayerAccount(source); if a then outputDebugString(getElementData(source,"combattime")) setAccountData(a,"combattime",getElementData(source,"combattime")) end end addEventHandler("onPlayerQuit",getRootElement(),saveData) Server Here, Now client: combatloglabel = guiCreateLabel(0.82, 0.00, 0.27, 0.04, "A", true) guiSetVisible(combatloglabel,false) function createLogLabel() guiSetVisible(combatloglabel,true) guiLabelSetHorizontalAlign(combatloglabel, "center", false) guiLabelSetVerticalAlign(combatloglabel, "center") guiSetText(combatloglabel,"[Out of combat]") guiLabelSetColor(combatloglabel, 17, 249, 5) end addEventHandler("onClientPlayerSpawn",localPlayer,createLogLabel) function onPlayerActivateCombatLog(attacker) if source == localPlayer then guiSetText(combatloglabel,"[In combat]\nDont disconnect or you will die") guiLabelSetColor(combatloglabel,255,0,0) triggerServerEvent("setAccount1", localPlayer) setTimer(function(localPlayer) triggerServerEvent("setAccount2", localPlayer) guiSetText(combatloglabel,"[Out of combat]") guiLabelSetColor(combatloglabel, 17, 249, 5) end,10000,1,localPlayer) end end addEventHandler("onClientPlayerDamage",root,onPlayerActivateCombatLog) It should work is tested now. Also when u trigger a server event always check for client because source can be some fake data and in more complicated scripts it can create problems. Thats why i used client when i trigger a server event!1 point
-
didnt work but I think its something about "my" code thats not right... like [13:10:16] ERROR: Client (Sirr) triggered serverside event getAccount, but event is not added serverside [13:10:26] ERROR: Client (Sirr) triggered serverside event setAccount2, but event is not added serverside why does it says that if both events are in my server.lua file? 100% sure as you can see in the script above1 point
-
function saveData() if source then local a = getPlayerAccount(source); if a then if not isGuestAccount(a) then setAccountData(a,"combattime",tonumber(getAccountData(a,"combattime"))) end end end end addEventHandler("onPlayerQuit",getRootElement(),saveData) This should work but i did not test it. Also here is a topic which might help you. -> https://forum.multitheftauto.com/topic/106193-help-save-account-data/1 point