This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

asdasd


Post New Thread Reply   
 
Thread Tools Display Modes
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 03-22-2014 , 13:03   Re: GetPlayers Bugging
Reply With Quote #11

Quote:
Originally Posted by claudiuhks View Post
Regarding your first message, you need to zero your variables before using them. They are declared as static, and they never reset themselves until plugin reloads.

PHP Code:
GetPlayersCount(Team)
{
  static 
Players 0Player 0;

  
Players 0;

  for (
Player 1Player <= get_maxplayers(); Player++)
  {
    if (
is_user_connected(Player) && get_user_team(Player) == Team)
      
Players++;
  }

  return 
Players;

Testing

Last edited by Kellan123; 03-22-2014 at 13:04.
Kellan123 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:03.


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