время на сервере
#3

pawn Code:
#include <a_samp>

forward ClockSync(playerid);
new Text:Clock;
new chour, cmin;

public OnFilterScriptInit()
{
  Clock = TextDrawCreate(547.000000,24.000000,"00:00");
  TextDrawAlignment(Clock,0);
  TextDrawBackgroundColor(Clock,0x000000ff);
  TextDrawFont(Clock,3);
  TextDrawLetterSize(Clock,0.6,1.9);
  TextDrawColor(Clock,0xffffffff);
  TextDrawSetOutline(Clock,2);
  TextDrawSetProportional(Clock,1);
  TextDrawSetShadow(Clock,1);
  SetTimer("ClockSync", 1000, 1);
}

public OnPlayerSpawn(playerid)
{
  TextDrawShowForPlayer(playerid,Clock);
  return 1;
}

public OnPlayerDeath(playerid)
{
  TextDrawHideForPlayer(playerid,Clock);
  return 1;
}

public ClockSync(playerid)
{
  new string[64];

  if(cmin == 59)
  {
    cmin = 0;
    if(chour == 23) chour = 0;
    else chour++;
  }
  else cmin++;

  for(new i=0; i<GetMaxPlayers(); i++) if(GetPlayerState(i) != PLAYER_STATE_NONE && IsPlayerConnected(i)) SetPlayerTime(i,chour,cmin);

  format(string, 64, "%02d:%02d", chour, cmin);
  TextDrawSetString(Text:Clock, string);
  SetWorldTime(chour);
}
Попробуй как-то так.
Reply


Messages In This Thread
время на сервере - by f0rtex - 20.08.2010, 15:49
Re: время на сервере - by MX_Master - 20.08.2010, 16:15
Re: время на сервере - by enfall - 20.08.2010, 16:21
Re: время на сервере - by ZaR - 20.08.2010, 17:05
Re: время на сервере - by f0rtex - 20.08.2010, 17:58
Re: время на сервере - by ZiGGi - 20.08.2010, 18:04
Re: время на сервере - by MX_Master - 20.08.2010, 18:16
Re: время на сервере - by Фархад - 07.10.2010, 20:25
Re: время на сервере - by [CripZ]SERCH - 08.10.2010, 09:44

Forum Jump:


Users browsing this thread: 1 Guest(s)