Raised This Month: $ Target: $400
 0% 

Modindependent way to count team and enemies?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 01-27-2007 , 10:01   Re: Modindependent way to count team and enemies?
Reply With Quote #1

yes, very easy.
Code:
for(new i=0;i<=32;i++)   new team = pev(i,pev_team)

Here a litle complete example:You only need the team id number.
I am NOT 100% sure(1= CT,Axis/2= Terror,Allies/0= Spectator)
Code:
public count_players() {  new teamA,teamB  for(new i=0;i<=32;i++)  {   new team = pev(i,pev_team)   if(team == 1)    teamA++   else if(team == 2)    teamB++   client_print(0,print_chat,"TeamA have %d Player,TeamB have %d Player",teamA,teamB)  } }

For the teamnames there exist an event:http://wiki.amxmodx.org/index.php/Ha...t for all Mods
__________________

Last edited by schnitzelmaker; 01-27-2007 at 11:56.
schnitzelmaker is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 02-11-2007 , 12:23   Re: Modindependent way to count team and enemies?
Reply With Quote #2

Works quite well, karma++ for this.
Isobold 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 22:27.


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