Raised This Month: $81 Target: $400
 20% 

Maximum Allowed Players on a Map


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cuttlas
Senior Member
Join Date: Jan 2015
Old 12-02-2023 , 14:51   Maximum Allowed Players on a Map
Reply With Quote #1

I figured out that some maps have a maximum number of allowed players.

for example, if the map can handle 5 players and you add (join) 6 players, the rest will die on spawn or the whole map (game) will crash.

If I'm right about this, then is there any amx API (command) to get this value so that I can handle the players count?
__________________
To Infinity n Beyond
Cuttlas is offline
thEsp
BANNED
Join Date: Aug 2017
Old 12-02-2023 , 14:59   Re: Maximum Allowed Players on a Map
Reply With Quote #2

You can retrieve the limit by counting how many spawn point entities the map has. info_player_start/info_player_deathmatch
thEsp is offline
ZarZar
New Member
Join Date: Nov 2023
Location: Germany
Old 12-02-2023 , 15:51   Re: Maximum Allowed Players on a Map
Reply With Quote #3

add spawn editor Plugin and remake spawn Points 16 T/16 CT
ZarZar is offline
Cuttlas
Senior Member
Join Date: Jan 2015
Old 12-02-2023 , 16:22   Re: Maximum Allowed Players on a Map
Reply With Quote #4

should I sum up both counts?

I summed up both and got 12 for a map (info_player_start = 6, info_player_deathmatch =6), but the max number of players is 8, if it becomes 9 players the game will crash!!!
__________________
To Infinity n Beyond

Last edited by Cuttlas; 12-02-2023 at 16:46.
Cuttlas is offline
101
Member
Join Date: Nov 2023
Old 12-03-2023 , 01:56   Re: Maximum Allowed Players on a Map
Reply With Quote #5

it crashed because of heavy load of your script .
i remember i have read one of ur script was like this :
Quote:
public plugin_init()
{
RegisterHam(Ham_Touch, "weapon_hegrenade", "player_touchweapon")
RegisterHam(Ham_Touch, "weaponbox", "player_touchweapon")
RegisterHam(Ham_Touch, "armoury_entity", "player_touchweapon")
}

public player_touchweapon(id, ent)
if (is_user_bot(id))return HAM_SUPERCEDE
while the correct function callback param and usage should be like :
PHP Code:
public player_touchweapon(ent,id
{
    if (
id<|| id>MaxPlayers || !is_user_bot(id))return HAM_IGNORED;
    
//do whatever ... , if u want to block ALL-Weapons pick up for Bots Just Add this line:
    
return HAM_SUPERCEDE;

anyway , <as i know> players limit depends on:
1- maxplayers <Value> (maxplayers 32)
2- MAX Number of Spawn Points that each map provides which can be detected by counting info_player_ Entities .
So Hope This Will Help :

PHP Code:
#include <amxmodx>
#include <fakemeta>

new g_FMSpawn,Allowable_Spawn_Points;
new 
class_name[32];

public 
plugin_precache()
{
    
Allowable_Spawn_Points=0;
    
g_FMSpawn register_forward(FM_Spawn"EntSpawn");
    
//log_amx("-----------plugin_precache-----------");
}

public 
plugin_init()
{
    
//log_amx("-----------plugin_init-----------");
    
unregister_forward(FM_Spawng_FMSpawn);
    
register_clcmd("say /ttt","CmdSpawnInfo");
}

public 
EntSpawn(ent)
{
    if(!
pev_valid(ent))
    {
        return 
FMRES_IGNORED;
    }
    
peventpev_classnameclass_namecharsmax(class_name));
    if(
contain(class_name,"info_player_") != -1)
    {
        
Allowable_Spawn_Points++;
    }
    return 
FMRES_IGNORED;
}

public 
CmdSpawnInfo(id)
{
    
client_print(idprint_chat,"Spawn Points limit in this map =%d - Max Players Server Allow =%d",Allowable_Spawn_Points,get_maxplayers());

Attached Files
File Type: sma Get Plugin or Get Source (Spawn_Info_Method1.sma - 18 views - 908 Bytes)
File Type: sma Get Plugin or Get Source (Spawn_Info_Method2.sma - 21 views - 486 Bytes)
File Type: sma Get Plugin or Get Source (Weapons_Pickup_Control.sma - 22 views - 646 Bytes)
101 is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 12-03-2023 , 08:59   Re: Maximum Allowed Players on a Map
Reply With Quote #6

this plugin breaks the limit no matter how many players the map supports.
__________________
mlibre is offline
Cuttlas
Senior Member
Join Date: Jan 2015
Old 12-03-2023 , 09:15   Re: Maximum Allowed Players on a Map
Reply With Quote #7

thank you @101, but no, it is not related to my codes because I have disabled the whole amxmodx.

the problem comes from this map: https://all-cs.ru/cs16/maps/aim/aim_sadism.html

If more than 8 players join the map, the whole game will crash. but the value for max players is 24, and the spawn points are 12. I did not understand where is the problem.

and @mlibre thank you too, bro. I should test that plugin soon on the target map.
__________________
To Infinity n Beyond
Cuttlas is offline
Cuttlas
Senior Member
Join Date: Jan 2015
Old 12-03-2023 , 16:00   Re: Maximum Allowed Players on a Map
Reply With Quote #8

I have tested this plugin: https://forums.alliedmods.net/showpo...59&postcount=1
both with AUTO_SPAWNCREATOR and without that.

no success on this map: https://all-cs.ru/cs16/maps/aim/aim_sadism.html, it will crash for more than8 players. As long as the Spawn Points are 12.

also, the mentioned plugin did not work on the famous aim_headshot map I set the number of bots to 32 + myself, some of them will die on spawn.
__________________
To Infinity n Beyond

Last edited by Cuttlas; 12-14-2023 at 16:05.
Cuttlas is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 12-05-2023 , 08:42   Re: Maximum Allowed Players on a Map
Reply With Quote #9

works just fine for me with amxx and 12 bots. you're doing things wrong.
EDIT: use the attached sma to find and render spawn points for testing
neccessary include: https://forums.alliedmods.net/attach...8&d=1573914557
Attached Thumbnails
Click image for larger version

Name:	Image 1 (1).jpg
Views:	21
Size:	40.2 KB
ID:	202418  
Attached Files
File Type: sma Get Plugin or Get Source (D7TestEntSpawn.sma - 11 views - 6.1 KB)
__________________

Last edited by georgik57; 12-05-2023 at 08:50.
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode