5150 Posted September 20, 2015 Share Posted September 20, 2015 how can i save the teams when i restart my server? is there a certain script? also, how can i save player money on server restart? its kind of important for my server Link to comment
1LoL1 Posted September 20, 2015 Share Posted September 20, 2015 You can download here: Here Link to comment
5150 Posted September 20, 2015 Author Share Posted September 20, 2015 i have this but it doesnt save when y server restarts. maybe i did something wrong? Link to comment
KariiiM Posted September 20, 2015 Share Posted September 20, 2015 Here you go, i did this part for you it will get the player's team if the resource stopped , now you have to get the element data to your code function saveTeam() for index, vTeam in pairs(getElementsByType("player")) do if (getPlayerTeam(vTeam)) then local aTeam = getTeamName(getPlayerTeam(vTeam)) setElementData(vTeam,"setTeam",tostring(aTeam)) end end end addEventHandler("onResourceStop", getRootElement(),saveTeam) Link to comment
5150 Posted September 20, 2015 Author Share Posted September 20, 2015 no guys i mean, when i restart the server, all teams are deleted from my server. like, i have the staff team, then restart and staff team is deleted Link to comment
KariiiM Posted September 20, 2015 Share Posted September 20, 2015 AH, so you've to add your resource name in the mtaserver.conf Link to comment
JR10 Posted September 20, 2015 Share Posted September 20, 2015 If you're creating the teams with the admin panel, then you'll need a different way to save the teams, like SQL. If you're creating the teams with the functions, then simply starting the resource will create the teams. Link to comment
Mario222 Posted May 13, 2021 Share Posted May 13, 2021 How to configure the admin panel so that the teams are not deleted when the server is restarted and save the teams in sql? Link to comment
Administrators Tut Posted May 13, 2021 Administrators Share Posted May 13, 2021 As this thread is showing its age, I've applied a lock. If you require any more help, please create a new thread so that you can get the custom help you need. Link to comment
Recommended Posts