(2022-03-30, 07:41 AM)Axitz Wrote: but whenever server restart or player quit, then create team, it always started at 0 again.
This is due to a "teamidd" variable reset on exit.
You should add? teamidd? where you load the teams.
-------------------------------------------------------
Recommended:
If you want to get a free team ID, use this function:
Code:
GetFreeTeamID() {
? ? for (new i; i < MAX_TEAMS; i) {
? ? ? ? if (TeamInfo[i][TActive] == false)
? ? ? ? ? ? return i;
? ? }
? ? return -1; //Return -1 when there is no free team ID
}
Code:
new tmID = GetFreeTeamID();
if (tmID == -1)
? ? return 1; //No free team ID
else
? ? TeamInfo[tmID][TActive] = true;