AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to return dead ct players? (https://forums.alliedmods.net/showthread.php?t=184444)

kiki33hun 05-05-2012 10:21

How to return dead ct players?
 
This stock posibble?

PHP Code:

stock bool:is_dead_ct(id)
{
    new 
CsTeams:team cs_get_user_team(id);
    if(!
is_user_alive(id) && team == CS_TEAM_CT) return true;
    
    return 
false;



<VeCo> 05-05-2012 11:06

Re: How to return dead ct players?
 
This seems to work, why don't you test it?

kiki33hun 05-05-2012 11:13

Re: How to return dead ct players?
 
Idont test, iam online mobile phone:D

claudiuhks 05-05-2012 11:15

Re: How to return dead ct players?
 
PHP Code:

GetDeadCTCount( ) {
  static 
iPlayers32 ], iNum;
  
/* b = Alive players are skipped, e = Match with the followed team */
  
get_playersiPlayersiNum"be""CT" );

  return 
iNum;


Is not working in Zombie Plague though.

For Zombie Plague:

PHP Code:

#include < fakemeta >

#define OFFSET_CSTEAMS 114
#define TEAM_CT 2
#define TEAM_T 1

GetAliveHumansCount( ) {
  static 
imaxClientsiCount; if( !maxClients maxClients get_maxplayers( ); iCount 0;

  for( 
1maxClients 1i++ )
    if( 
is_user_connected) && !is_user_alive) && get_pdata_intiOFFSET_CSTEAMS ) == TEAM_CT )
      
iCount++;

  return 
iCount;



kiki33hun 05-05-2012 11:19

Re: How to return dead ct players?
 
Count????? No count, read frist post please

claudiuhks 05-05-2012 11:21

Re: How to return dead ct players?
 
Quote:

Originally Posted by kiki33hun (Post 1702647)
Count????? No count, read frist post please

Your title sais: How to return dead ct players?

So? What should I understand? :rtfm::rtfm::rtfm::rtfm:

MeRcyLeZZ said:

PHP Code:

// Get Alive CTs
fnGetAliveCTs()
{
    static 
iCTsid
    iCTs 
0
    
    
for (id 1id <= g_maxplayersid++)
    {
        if (
g_isalive[id])
        {            
            if (
fm_cs_get_user_team(id) == FM_CS_TEAM_CT)
                
iCTs++
        }
    }
    
    return 
iCTs;


Then, Get Alive Counter-Terrorists will return the count of them. Sorry for that :(

kiki33hun 05-05-2012 11:27

Re: How to return dead ct players?
 
lol sorry wrong topic name! Players -> player

<VeCo> 05-05-2012 11:34

Re: How to return dead ct players?
 
So your function should work..

Liverwiz 05-05-2012 16:50

Re: How to return dead ct players?
 
Quote:

Originally Posted by claudiuhks (Post 1702649)
Your title sais: How to return dead ct players?

So? What should I understand? :rtfm::rtfm::rtfm::rtfm:

claudiuhks is grumpy today.

@OP....your functoin should work. I see nothing wrong with it.
Not sure about stock. But the logic is correct.

kiki33hun 05-06-2012 01:53

Re: How to return dead ct players?
 
Okey, thanx information.


All times are GMT -4. The time now is 00:24.

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