AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [SNIPPED] CS_GetValidSpawnTeam (https://forums.alliedmods.net/showthread.php?t=228624)

zipcore 10-23-2013 16:47

[SNIPPED] CS_GetValidSpawnTeam
 
PHP Code:

stock CS_GetValidSpawnTeam()
{
new 
maxEnt GetMaxEntities(), tcountctcount;
decl String:sClassName[64];
for (new 
MaxClientsmaxEnti++)
{
if (
IsValidEdict(i) && IsValidEntity(i) && GetEdictClassname(isClassNamesizeof(sClassName)))
{
if (
StrEqual(sClassName"info_player_terrorist"))
{
tcount++;
}
else if (
StrEqual(sClassName"info_player_counterterrorist"))
{
ctcount++;
}
}
}

if(
tcount 0) return CS_TEAM_T;
else if(
ctcount 0) return CS_TEAM_CT;

else return 
CS_TEAM_NONE;



Bacardi 10-24-2013 20:20

Re: [SNIPPED] CS_GetValidSpawnTeam
 
Spoiler

zipcore 10-25-2013 03:07

Re: [SNIPPED] CS_GetValidSpawnTeam
 
for my plugins this wasn't needed, but GJ & TY :wink:

Franc1sco 10-25-2013 06:43

Re: [SNIPPED] CS_GetValidSpawnTeam
 
I'm not sure what use could have this, could you give an example of its use?

Bacardi 10-25-2013 06:50

Re: [SNIPPED] CS_GetValidSpawnTeam
 
...lookin hes code, it will mostly return as value CS_TEAM_T team index.
Need have only one info_player_terrorist entity on map and that's it.

Franc1sco 10-25-2013 06:56

Re: [SNIPPED] CS_GetValidSpawnTeam
 
Quote:

Originally Posted by Bacardi (Post 2052669)
...lookin hes code, it will mostly return as value CS_TEAM_T team index.
Need have only one info_player_terrorist entity on map and that's it.

I see.. ok but I only found one use, in maps that only allow 1 team like bhop maps, any more?

zipcore 10-26-2013 05:20

Re: [SNIPPED] CS_GetValidSpawnTeam
 
Quote:

Originally Posted by Franc1sco (Post 2052672)
I see.. ok but I only found one use, in maps that only allow 1 team like bhop maps, any more?

correct


All times are GMT -4. The time now is 18:28.

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