Optimization includes tweaking and changing things to make them faster or take up less memory.
There's lots of small things you can optimize, the 4 i would encourage most are:
Decrease string sizes as much as possible, or atleast make sure when using SCM that they're not beyond 128.
Use includes like zcmd/ycmd (not dcmd) for faster commands, and foreach for faster player loops.
Redefine "MAX_PLAYERS" to the actual max player slots you have set on your server right after
#include <a_samp>
An example of how to set it to 100 players:
Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 100
Don't save players when they disconnect, save them instantly when their things are changed that needs to be saved.
Otherwise the server hangs when players disconnect.