• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] cache_insert_id always return 0
#5
(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;
  Reply


Messages In This Thread
cache_insert_id always return 0 - by Axitz - 2022-03-30, 07:41 AM
RE: cache_insert_id always return 0 - by FARADAY - 2022-03-31, 07:11 PM
RE: cache_insert_id always return 0 - by Axitz - 2022-04-01, 03:02 AM
RE: cache_insert_id always return 0 - by FARADAY - 2022-04-01, 09:56 PM
RE: cache_insert_id always return 0 - by Radical - 2022-04-01, 10:07 PM
RE: cache_insert_id always return 0 - by Axitz - 2022-04-07, 04:07 AM