5150 Posted September 20, 2015 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
5150 Posted September 20, 2015 Author Posted September 20, 2015 i have this but it doesnt save when y server restarts. maybe i did something wrong?
KariiiM Posted September 20, 2015 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)
5150 Posted September 20, 2015 Author 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
KariiiM Posted September 20, 2015 Posted September 20, 2015 AH, so you've to add your resource name in the mtaserver.conf
JR10 Posted September 20, 2015 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.
Mario222 Posted May 13, 2021 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?
Moderators Tut Posted May 13, 2021 Moderators 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.
Recommended Posts