17.04.2011, 14:32
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

