Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- new Text:relogio1;
- new Text:relogio2;
- public OnFilterScriptInit()
- {
- relogio1 = TextDrawCreate(153.000000, 364.000000, "00/00/0000");
- TextDrawFont(relogio1, 1);
- TextDrawLetterSize(relogio1, 0.220833, 1.550000);
- TextDrawTextSize(relogio1, 400.000000, 17.000000);
- TextDrawSetOutline(relogio1, 1);
- TextDrawSetShadow(relogio1, 0);
- TextDrawAlignment(relogio1, 1);
- TextDrawColor(relogio1, -1);
- TextDrawBackgroundColor(relogio1, 255);
- TextDrawBoxColor(relogio1, 50);
- TextDrawUseBox(relogio1, 0);
- TextDrawSetProportional(relogio1, 1);
- TextDrawSetSelectable(relogio1, 0);
- relogio2 = TextDrawCreate(159.000000, 382.000000, "00:00:00");
- TextDrawFont(relogio2, 1);
- TextDrawLetterSize(relogio2, 0.220833, 1.550000);
- TextDrawTextSize(relogio2, 400.000000, 17.000000);
- TextDrawSetOutline(relogio2, 1);
- TextDrawSetShadow(relogio2, 0);
- TextDrawAlignment(relogio2, 1);
- TextDrawColor(relogio2, -1);
- TextDrawBackgroundColor(relogio2, 255);
- TextDrawBoxColor(relogio2, 50);
- TextDrawUseBox(relogio2, 0);
- TextDrawSetProportional(relogio2, 1);
- TextDrawSetSelectable(relogio2, 0);
- SetTimer("AtualizarRelogio", 1000, true);
- print("[FS] Hora e Data carregado com sucesso.");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("[FS] Hora e Data descarregado com sucesso.");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, relogio1);
- TextDrawShowForPlayer(playerid, relogio2);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, relogio1);
- TextDrawHideForPlayer(playerid, relogio2);
- return 1;
- }
- forward AtualizarRelogio();
- public AtualizarRelogio()
- {
- new ano, meses, dias, horas, minutos, segundos, string[128], string2[128];
- gettime(horas, minutos, segundos);
- getdate(ano, meses, dias);
- format(string,sizeof(string), "%02d/%02d/%d", dias, meses, ano);
- TextDrawSetString(relogio1, string);
- format(string2,sizeof(string2),"%02d:%02d:%02d", horas, minutos, segundos);
- TextDrawSetString(relogio2, string2);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement