Raised This Month: $51 Target: $400
 12% 

get if a hltv is connected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 09-12-2007 , 14:44   get if a hltv is connected
Reply With Quote #1

Quote:
If specified, you can constrain which players are returned by flags:
"a" - Don't return dead players
"b" - Don't return alive players
"c" - Skip bots
"d" - Skip real players
"e" - Match with passed team
"f" - Match with part of name
"g" - Ignore case sensitivity
"h" - Skip HLTV

Example, Get dead players:
new Players[32]
new playerCount, i, player
get_players(Players, playerCount, "b")
for (i=0; i<playerCount; i++)
player = Players[i]
what would return count of hltvīs:
Code:
get_players(Players, playerCount, "abc");
return playerCount;
or
Code:
get_players(Players, playerCount, "cd");
return playerCount;

or is there a better way?
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-12-2007 , 15:11   Re: get if a hltv is connected
Reply With Quote #2

Maybe something like :

Code:
    new g_maxplayers;     public plugin_init()     {         g_maxplayers = get_maxplayers();     }     stock hltv_count()     {         new cnt;                 for( new i = 1; i <= g_maxplayers; i ++ )         {             if( is_user_hltv( i ) )                 ++cnt;         }                 return cnt;     }
__________________

Last edited by Arkshine; 09-12-2007 at 15:52.
Arkshine is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 09-12-2007 , 15:49   Re: get if a hltv is connected
Reply With Quote #3

thx,

this is the way i did it, but it seems not working with get_players.
im wondering why...
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
kp_uparrow
Penalized Member
Join Date: Jun 2006
Location: 192.168.0.1
Old 09-12-2007 , 16:34   Re: get if a hltv is connected
Reply With Quote #4

alot of things dont work right with get players, do it manually
__________________
I USED A SECOND ACCOUNT TO DO MORE KARMA UPS AND DOWNS UNTIL GREENTRYST CAUGHT ME
kp_uparrow is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-13-2007 , 08:23   Re: get if a hltv is connected
Reply With Quote #5

Assuming get_players does work right, the count of HLTV's is:
Code:
{ new players[32],count1,count2; get_players(players,count1) get_players(players,count2,"h") log_amx("HLTV's: %i",count1-count2) }
purple_pixie is offline
|PJ| Shorty
Veteran Member
Join Date: Aug 2005
Location: Bavaria, Germany
Old 09-13-2007 , 09:11   Re: get if a hltv is connected
Reply With Quote #6

Quote:
Originally Posted by purple_pixie View Post
Assuming get_players does work right, the count of HLTV's is:

Code:
{
new players[32],count1,count2;
get_players(players,count1)
get_players(players,count2,"h")
log_amx("HLTV's: %i",count1-count2)
}
nice way! like this code
__________________
There are only 10 types of people in the world:
Those who understand binary, and those who donīt.
|PJ| Shorty is offline
Send a message via ICQ to |PJ| Shorty Send a message via AIM to |PJ| Shorty Send a message via MSN to |PJ| Shorty Send a message via Yahoo to |PJ| Shorty Send a message via Skype™ to |PJ| Shorty
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:32.


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