AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to find out howmany player(T or CT) spawn point in a map? (https://forums.alliedmods.net/showthread.php?t=40763)

jopmako 07-03-2006 08:59

How to find out howmany player(T or CT) spawn point in a map?
 
Code:

new T_spawn = find_ent_by_class ( -1, "info_player_deathmatch" )
//resul: map de_train
T_spawn = 34

It's not correctly. (is 12)

Actuality I want to find out howmany spawn point in a map, and add new spawn point in running time if no enough.

any one help?

VEN 07-03-2006 09:37

Re: How to find out howmany player(T or CT) spawn point in a map?
 
For example:
PHP Code:

new entmax_tsmax_cts
 
while ((ent find_ent_by_class(ent"info_player_deathmatch")))
    
max_ts++
 
while ((
ent find_ent_by_class(ent"info_player_start")))
    
max_cts++ 


Hawk552 07-03-2006 09:50

Re: How to find out howmany player(T or CT) spawn point in a map?
 
Quote:

Originally Posted by jopmako
Code:

new T_spawn = find_ent_by_class ( -1, "info_player_deathmatch" )
//resul: map de_train
T_spawn = 34

It's not correctly. (is 12)

Actuality I want to find out howmany spawn point in a map, and add new spawn point in running time if no enough.

any one help?

If you couldn't figure out how to do that, you're going to have a hard time adding more spawns dynamically.

jopmako 07-03-2006 13:35

Re: How to find out howmany player(T or CT) spawn point in a map?
 
Quote:

Originally Posted by VEN
For example:
PHP Code:

new entmax_tsmax_cts
 
while ((ent find_ent_by_class(ent"info_player_deathmatch")))
max_ts++
 
while ((
ent find_ent_by_class(ent"info_player_start")))
max_cts++ 


ok it work ,thanks

jopmako 07-03-2006 13:42

Re: How to find out howmany player(T or CT) spawn point in a map?
 
Quote:

Originally Posted by Hawk552
If you couldn't figure out how to do that, you're going to have a hard time adding more spawns dynamically.



Is that have a way to add player spawns in running time?

How to do that?


thanks for your help.

Hawk552 07-03-2006 13:45

Re: How to find out howmany player(T or CT) spawn point in a map?
 
The only way I can think of is to scan around a current spawn and use PointContents to see if there is anything in the spot or within a few units around it. If not, then spawn an info_player_start/_deathmatch.

jopmako 07-03-2006 14:13

Re: How to find out howmany player(T or CT) spawn point in a map?
 
yeah,find out the spawns is work find now.

If i using create_entity("info_player_deathmatch") to create a spawn point.
It is that meaning the map(22max.player) add to (23max.player)
and player can join?

Hawk552 07-03-2006 14:20

Re: How to find out howmany player(T or CT) spawn point in a map?
 
Quote:

Originally Posted by jopmako
yeah,find out the spawns is work find now.

If i using create_entity("info_player_deathmatch") to create a spawn point.
It is that meaning the map(22max.player) add to (23max.player)
and player can join?

Yes, but you can't just create it. You need to give it an origin, otherwise players will spawn at 0,0,0.

jopmako 07-03-2006 14:37

Re: How to find out howmany player(T or CT) spawn point in a map?
 
Quote:

Originally Posted by Hawk552
Yes, but you can't just create it. You need to give it an origin, otherwise players will spawn at 0,0,0.

thanks a lot.:D


All times are GMT -4. The time now is 08:05.

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