Raised This Month: $ Target: $400
 0% 

asdasd


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 03-22-2014 , 12:20   Re: GetPlayers Bugging
Reply With Quote #10

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;

__________________

Last edited by claudiuhks; 03-22-2014 at 12:23.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
 



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 05:54.


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