MAX_PLAYERS: Fix plugins

This commit is contained in:
Arkshine
2015-02-01 19:20:55 +01:00
parent 1b350b627b
commit e441908230
32 changed files with 181 additions and 202 deletions

View File

@@ -19,10 +19,10 @@
#define CHECK_FREQ 5 // This is also the warning message frequency.
#define CLASS_GESTATE 9
new g_oldangles[MAX_PLAYERS][3]
new g_idletime[MAX_PLAYERS]
new bool:g_spawned[MAX_PLAYERS] = {true, ...}
new g_class[MAX_PLAYERS] // stored info from the "ScoreInfo" message
new g_oldangles[MAX_PLAYERS + 1][3]
new g_idletime[MAX_PLAYERS + 1]
new bool:g_spawned[MAX_PLAYERS + 1] = {true, ...}
new g_class[MAX_PLAYERS + 1] // stored info from the "ScoreInfo" message
new mp_tournamentmode;
new amx_idle_time;
@@ -129,17 +129,9 @@ public delayedSpawn(sid[]) {
public msgScoreInfo() {
new id=read_data(1);
if (id>32||id<1) {
// just incase..
return;
}
g_class[id]=read_data(5);
}
public msgScoreInfo32() {
new id=read_data(1);
if (id>32||id<1) {
// just incase..
return;
}
g_class[id]=read_data(6);
}

View File

@@ -115,7 +115,7 @@ public getNextValidMap(szNextMap[]) {
while(looped < 2) {
new minPlayers = g_mapCycle[g_nextPos][MIN]
new maxPlayers = g_mapCycle[g_nextPos][MAX]
if (maxPlayers == 0) maxPlayers = 32
if (maxPlayers == 0) maxPlayers = MAX_PLAYERS
if (minPlayers <= g_numPlayers <= maxPlayers) break
if (minPlayers <= curNumPlayers <= maxPlayers) {
g_numPlayers = curNumPlayers
@@ -215,9 +215,9 @@ readMapCycle() {
new szKey1[11], szKey2[11], szValue1[3], szValue2[3]
parse(szMapPlayerNum, szKey1, charsmax(szKey1), szValue1, charsmax(szValue1), szKey2, charsmax(szKey2), szValue2, charsmax(szValue2))
if (equal(szKey1, "minplayers"))
g_mapCycle[g_numMaps][MIN] = clamp(str_to_num(szValue1), 0, 32)
g_mapCycle[g_numMaps][MIN] = clamp(str_to_num(szValue1), 0, MAX_PLAYERS)
if (equal(szKey2, "maxplayers"))
g_mapCycle[g_numMaps][MAX] = clamp(str_to_num(szValue2), 0, 32)
g_mapCycle[g_numMaps][MAX] = clamp(str_to_num(szValue2), 0, MAX_PLAYERS)
if (++g_numMaps == MAX_MAPS) break
}

View File

@@ -50,9 +50,8 @@ enum {
TEAM_SPECTATOR
};
new g_Class[MAX_PLAYERS]; // stored info from the "ScoreInfo" message
new g_Team[MAX_PLAYERS];
new g_Class[MAX_PLAYERS + 1] = {0, ...}; // stored info from the "ScoreInfo" message
new g_Team[MAX_PLAYERS + 1] = {1, ...};
new g_ScoreInfo_Class;
new g_ScoreInfo_Team;
@@ -80,14 +79,6 @@ public plugin_init() {
register_concmd("amx_random","cmdRandom",ADMIN_LEVEL_H,"<name or #userid> - omit to do all in rr");
register_concmd("amx_readyroom","cmdReadyRoom",ADMIN_LEVEL_H,"<name or #userid> - omit to do everybody");
// clear class info..
new i=0;
while (i<MAX_PLAYERS) {
g_Class[i]=0;
g_Team[i]=-1;
i++;
}
if (cvar_exists("sv_structurelimit"))
{
// ns 3.2 beta
@@ -106,10 +97,6 @@ public plugin_init() {
}
public msgScoreInfo() {
new id=read_data(1);
if (id>32||id<1) {
// just incase..
return;
}
g_Class[id]=read_data(g_ScoreInfo_Class);
g_Team[id]=read_data(g_ScoreInfo_Team);
}
@@ -123,7 +110,7 @@ public client_connect(id) {
}
stock UTIL_FindCommander() {
new i=1;
while (i<MAX_PLAYERS) {
while (i<=MAX_PLAYERS) {
if (g_Class[i]==PLAYERCLASS_COMMANDER) // this player is comm..
return i;
i++;

View File

@@ -15,14 +15,14 @@
#include <amxmisc>
#include <ns>
new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[MAX_PLAYERS]
new g_menuSettings[MAX_PLAYERS]
new g_menuPosition[MAX_PLAYERS + 1]
new g_menuPlayers[MAX_PLAYERS + 1][32]
new g_menuPlayersNum[MAX_PLAYERS + 1]
new g_menuOption[MAX_PLAYERS + 1]
new g_menuSettings[MAX_PLAYERS + 1]
new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[MAX_PLAYERS]
new g_menuSelect[MAX_PLAYERS + 1][64]
new g_menuSelectNum[MAX_PLAYERS + 1]
#define MAX_CLCMDS 24

View File

@@ -18,7 +18,7 @@
#define MAX_ATTEMPTS 128 // How many times to search in an area for a free space
#define BLOCKED_MASKS MASK_PLAYER_STUNNED | MASK_ENSNARED | MASK_ALIEN_EMBRYO
new Float:g_lastcmdtime[MAX_PLAYERS]
new Float:g_lastcmdtime[MAX_PLAYERS + 1]
new amx_unstuck_frequency;