17.03.2015, 18:51
(
Последний раз редактировалось alexus; 17.03.2015 в 19:08.
Причина: Corrections
)
I will give you all the necessary:
OnGameModeInit
OnPlayerConnect
OnPlayerSpawn
OnPlayerDeath
It will work with integer DIF_HOUR only
Код:
#define DIF_HOUR 4 // the difference between "gettime" hour and yours new hour, minute, Text:txtTime, timestr[32]; forward UpdateTime() public UpdateTime() { gettime(hour, minute); format(timestr,32,"%02d:%02d",hour,minute); TextDrawSetString(txtTime,timestr); new x=0; while(x!=MAX_PLAYERS) { if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) SetPlayerTime(x,hour,minute); x++; } hour += DIF_HOUR; if (hour>23) hour -= 24; SetWorldTime(hour); // here you add de difference in hours }
Код:
txtTime = TextDrawCreate(605.0,25.0,"00:00"); TextDrawUseBox(txtTime, 0); TextDrawFont(txtTime, 3); TextDrawSetShadow(txtTime,0); TextDrawSetOutline(txtTime,2); TextDrawBackgroundColor(txtTime,0x000000FF); TextDrawColor(txtTime,0xFFFFFFFF); TextDrawAlignment(txtTime,3); TextDrawLetterSize(txtTime,0.5,1.5); UpdateTime(); SetTimer("UpdateTime",1000 * 60,1);
Код:
TogglePlayerClock (playerid, 0); gettime (hour, minute); SetPlayerTime (playerid,hour,minute);
Код:
TextDrawShowForPlayer(playerid,txtTime); gettime(hour, minute); SetPlayerTime(playerid,hour,minute);
Код:
TextDrawHideForPlayer(playerid,txtTime);