mirror of
https://github.com/etlegacy/etlegacy-lua-scripts.git
synced 2024-11-26 14:20:54 +00:00
lua: (xpsave) fix for full servers
This commit is contained in:
parent
560a2c8b88
commit
34d3c9b97c
2 changed files with 7 additions and 8 deletions
10
README.md
10
README.md
|
@ -5,7 +5,7 @@ Lua scripts for the Legacy mod
|
||||||
|
|
||||||
## CONSTANTS
|
## CONSTANTS
|
||||||
|
|
||||||
** Scipts with useful constants for custom scripts
|
* Scripts with useful constants for custom scripts
|
||||||
|
|
||||||
|
|
||||||
## dynamite
|
## dynamite
|
||||||
|
@ -15,9 +15,7 @@ Lua scripts for the Legacy mod
|
||||||
|
|
||||||
## xpsave
|
## xpsave
|
||||||
|
|
||||||
*In development and not intended to be used for public servers yet*
|
* This script is intended for Legacy mod, but may work in NoQuarter 1.2.9 and above
|
||||||
|
* luasql module with sqlite3 driver is required
|
||||||
* This script is intended for Legacy mod, but may work in NoQuarter too
|
* the script could be tweaked to use file backend or other database drivers instead of sqlite3
|
||||||
* luasql module with sqlite3 driver is required, but other database drivers may be used instead with a small change
|
|
||||||
* it could be tweaked to use file backend instead
|
|
||||||
|
|
||||||
|
|
|
@ -141,9 +141,10 @@ end -- et_InitGame
|
||||||
|
|
||||||
function et_ShutdownGame(restart)
|
function et_ShutdownGame(restart)
|
||||||
local cno = 0
|
local cno = 0
|
||||||
|
local maxclients = tonumber(et.trap_Cvar_Get("sv_maxclients"))
|
||||||
|
|
||||||
-- iterate through clients and save their XP
|
-- iterate through clients and save their XP
|
||||||
while true do
|
while cno < maxclients do
|
||||||
local cs = et.trap_GetConfigstring(et.CS_PLAYERS + cno)
|
local cs = et.trap_GetConfigstring(et.CS_PLAYERS + cno)
|
||||||
|
|
||||||
if not cs or cs == "" then break end
|
if not cs or cs == "" then break end
|
||||||
|
|
Loading…
Reference in a new issue