Raised This Month: $ Target: $400
 0% 

[SNIPPED] CS_GetValidSpawnTeam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 10-23-2013 , 16:47   [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #1

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;

__________________

Last edited by asherkin; 01-14-2015 at 20:01.
zipcore is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-24-2013 , 20:20   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #2

Spoiler
Bacardi is offline
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 10-25-2013 , 03:07   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #3

for my plugins this wasn't needed, but GJ & TY
__________________
zipcore is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-25-2013 , 06:43   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #4

I'm not sure what use could have this, could you give an example of its use?
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-25-2013 , 06:50   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #5

...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.
Bacardi is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 10-25-2013 , 06:56   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
...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?
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
zipcore
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
Old 10-26-2013 , 05:20   Re: [SNIPPED] CS_GetValidSpawnTeam
Reply With Quote #7

Quote:
Originally Posted by Franc1sco View Post
I see.. ok but I only found one use, in maps that only allow 1 team like bhop maps, any more?
correct
__________________
zipcore is offline
Reply



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 18:28.


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