public UpdateTime(){ gettime(gOra, gPerc); SetWorldTime(gOra);new x = 1;while(x != MAX_PLAYERS){ if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE){ SetPlayerTime(x, gOra, gPerc);}x++;}if(gOra == 00 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 00 : 00 ))\");}else if(gOra == 01 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 01 : 00 ))\");}else if(gOra == 02 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 02 : 00 ))\");}else if(gOra == 03 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 03 : 00 ))\");}else if(gOra == 04 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 04 : 00 ))\");}else if(gOra == 05 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 05 : 00 ))\");}else if(gOra == 06 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 06 : 00 ))\");}else if(gOra == 07 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 07 : 00 ))\");}else if(gOra == 08 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 08 : 00 ))\");}else if(gOra == 09 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 09 : 00 ))\");}else if(gOra == 10 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 10 : 00 ))\");}else if(gOra == 11 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 11 : 00 ))\");}else if(gOra == 12 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 12 : 00 ))\");}else if(gOra == 13 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 13 : 00 ))\");}else if(gOra == 14 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 14 : 00 ))\");}else if(gOra == 15 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 15 : 00 ))\");}else if(gOra == 16 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 16 : 00 ))\");}else if(gOra == 17 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 17 : 00 ))\");}else if(gOra == 18 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 18 : 00 ))\");}else if(gOra == 19 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 19 : 00 ))\");}else if(gOra == 20 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 20 : 00 ))\");}else if(gOra == 21 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 21 : 00 ))\");}else if(gOra == 22 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 22 : 00 ))\");}else if(gOra == 23 && gPerc == 00){ SendClientMessageToAll(FONTOS, \"(( Az idõ 23 : 00 ))\");}return 1;}
#include #pragma tabsize 0new Text:txtTimeDisp;new hour, minute;new timestr[32];forward UpdateTime();public UpdateTime(){ gettime(hour, minute); format(timestr,32,\"%02d:%02d\",hour,minute); TextDrawSetString(txtTimeDisp,timestr); SetWorldTime(hour);new x=0;while(x!=MAX_PLAYERS) { if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) { SetPlayerTime(x,hour,minute); } x++;}}public OnGameModeInit(){// Init our text displaytxtTimeDisp = TextDrawCreate(605.0,25.0,\"00:00\");TextDrawUseBox(txtTimeDisp, 0);TextDrawFont(txtTimeDisp, 3);TextDrawSetShadow(txtTimeDisp,0); // no shadow TextDrawSetOutline(txtTimeDisp,2); // thickness 1 TextDrawBackgroundColor(txtTimeDisp,0x000000FF); TextDrawColor(txtTimeDisp,0xFFFFFFFF); TextDrawAlignment(txtTimeDisp,3);TextDrawLetterSize(txtTimeDisp,0.5,1.5);UpdateTime();SetTimer(\"UpdateTime\",1000 * 60,1);return 1;}public OnPlayerSpawn(playerid){TextDrawShowForPlayer(playerid,txtTimeDisp);gettime(hour, minute);SetPlayerTime(playerid,hour,minute);return 1;}public OnPlayerDeath(playerid, killerid, reason){ TextDrawHideForPlayer(playerid,txtTimeDisp);return 1;}public OnPlayerConnect(playerid){ gettime(hour, minute); SetPlayerTime(playerid,hour,minute); return 1;}