There is already exists natives in that mod
Quote:
/**
* Returns number of alive zombies.
*
* @return Zombie count.
*/
native zp_get_zombie_count()
/**
* Returns number of alive humans.
*
* @return Human count.
*/
native zp_get_human_count()
/**
* Returns number of alive nemesis.
*
* @return Nemesis count.
*/
native zp_get_nemesis_count()
/**
* Returns number of alive survivors.
*
* @return Survivor count.
*/
native zp_get_survivor_count()
|
PHP Code:
client_print( 0, print_chat, "Zombie: %i | Human: %i | Nemesis: %i | Survivor: %i", zp_get_zombie_count( ), zp_get_human_count( ), zp_get_nemesis_count( ), zp_get_survivor_count( ) )
Also if you want to do it using custom stock try this
PHP Code:
GetZombieCount( )
{
new iPlayer[ 32 ], iNum, iCount;
get_players( iPlayer, iNum )
for( new i; i < iNum; i++ )
{
if( zp_get_user_zombie( i ) ) // Is user zombie
{
iCount++;
}
}
return iCount; // Returns the number called from the loop
}
__________________