Count system!
#3

pawn Код:
// Put that on your script top
forward OnlineUpdate();
public OnlineUpdate()
{
     new string[200];
     new count = 0;
     for(new v; v < MAX_PLAYERS; ++v)
     {
           if(IsPlayerConnected(v))
           {
                   ++count;
           }
     }

     format(string,sizeof(string),"%d",count);
     TextDrawSetString(Online,string);
     return 1;
}
pawn Код:
// Put that on FilterScriptInit / GameModeInit (depends what you're using)
   new Online;
   Online = TextDrawCreate(546.000000,23.000000,"0");
   TextDrawAlignment(Online,0);
   TextDrawBackgroundColor(Online,0x000000ff);
   TextDrawFont(Online,2);
   TextDrawLetterSize(Online,0.299999,1.600000);
   TextDrawColor(Online,0xFF0000FF);
   TextDrawSetProportional(Online,1);
   TextDrawSetShadow(Online,1);
   SetTimer("OnlineUpdate", 4000, true); // Update each 4seconds || 1000ms = 1seg
Reply


Messages In This Thread
Count system! - by Admigo - 17.04.2011, 14:19
Re: Count system! - by [ADC]Aldi96 - 17.04.2011, 14:31
Re: Count system! - by blackwave - 17.04.2011, 14:32
Re: Count system! - by [ADC]Aldi96 - 17.04.2011, 14:33
Re: Count system! - by [ADC]Aldi96 - 17.04.2011, 14:37
Re: Count system! - by Admigo - 17.04.2011, 14:54
Re: Count system! - by Stigg - 17.04.2011, 14:59
Re: Count system! - by playbox12 - 17.04.2011, 15:00
Re: Count system! - by Admigo - 17.04.2011, 15:17
Re: Count system! - by Stigg - 17.04.2011, 15:37

Forum Jump:


Users browsing this thread: 1 Guest(s)