Advertisement
Guest User

Untitled

a guest
Oct 5th, 2013
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.21 KB | None | 0 0
  1. /*
  2. ______ _ _
  3. | ___ \ | | (_)
  4. | |_/ / ___ | | ___ __ _ _ ___
  5. | / / _ \| | / _ \ / _` || | / _ \
  6. | |\ \ | __/| || (_) || (_| || || (_) |
  7. \_| \_| \___||_| \___/ \__, ||_| \___/
  8. __/ |
  9. |___/
  10.  
  11. ______ _ _ _ _
  12. | _ \(_) (_)| | | |
  13. | | | | _ __ _ _ | |_ __ _ | |
  14. | | | || | / _` || || __| / _` || |
  15. | |/ / | || (_| || || |_ | (_| || |
  16. |___/ |_| \__, ||_| \__| \__,_||_|
  17. __/ |
  18. |___/
  19.  
  20.  
  21. - Samp Forum -
  22.  
  23. - Creditos -
  24.  
  25. - HeiO -
  26.  
  27. -- Ajuda --
  28.  
  29. -- Membros do Samp Forum --
  30.  
  31. */
  32.  
  33. #include <a_samp>
  34.  
  35. // Variaveis
  36.  
  37. new RDstring[ 12 ][ 2 ];
  38.  
  39. new HTtimeR;
  40.  
  41. new Text: RelogioCentral;
  42.  
  43. new Text: RelogioD[ 12 ];
  44.  
  45. new Text: RHoras;
  46.  
  47. new Text: RInfo;
  48.  
  49. new Text: RDias;
  50.  
  51. new Text: LMsg;
  52.  
  53. new Text: Linharel;
  54.  
  55. new Text: Linharel1;
  56.  
  57. new Text: Linharel2;
  58. //--
  59.  
  60. forward RelogioDigital (playerid);
  61.  
  62. forward RelogioData();
  63.  
  64.  
  65. public OnFilterScriptInit()
  66. {
  67.  
  68. RHoras = TextDrawCreate( 568.000000, 140.000000, "~w~Hora: 10~g~:~w~30~g~:~w~40"); //Pronto
  69. TextDrawBackgroundColor(RHoras, 255);
  70. TextDrawFont(RHoras, 1);
  71. TextDrawLetterSize(RHoras, 0.240000, 1.300000);
  72. TextDrawColor(RHoras, -1);
  73. TextDrawSetOutline(RHoras, 1);
  74. TextDrawSetProportional(RHoras, 1);
  75. TextDrawSetSelectable(RHoras, 0);
  76.  
  77. RInfo = TextDrawCreate(491.000000, 127.000000, "ld_pool:ball"); //Pronto
  78. TextDrawBackgroundColor( RInfo, 255);
  79. TextDrawFont(RInfo, 4);
  80. TextDrawLetterSize(RInfo, 0.250000, 0.699999);
  81. TextDrawColor(RInfo, -1);
  82. TextDrawSetOutline(RInfo, 1);
  83. TextDrawSetProportional(RInfo, 1);
  84. TextDrawUseBox(RInfo, 1);
  85. TextDrawBoxColor(RInfo, 255);
  86. TextDrawTextSize(RInfo, 78.000000, 82.000000);
  87. TextDrawSetSelectable(RInfo, 0);
  88.  
  89. RDias = TextDrawCreate(568.000000, 180.000000, "~w~Data: 10~g~/~w~20~g~/~w~2013"); //Pronto
  90. TextDrawBackgroundColor(RDias, 255);
  91. TextDrawFont(RDias, 1);
  92. TextDrawLetterSize(RDias, 0.210000, 1.300000);
  93. TextDrawColor(RDias, -1);
  94. TextDrawSetOutline(RDias, 1);
  95. TextDrawSetProportional(RDias, 1);
  96. TextDrawSetSelectable(RDias, 0);
  97.  
  98. LMsg = TextDrawCreate(583.000000, 159.000000, "Noite"); //Pronto
  99. TextDrawBackgroundColor(LMsg, 255);
  100. TextDrawFont(LMsg, 1);
  101. TextDrawLetterSize(LMsg, 0.290000, 1.200000);
  102. TextDrawColor(LMsg, -1);
  103. TextDrawSetOutline(LMsg, 1);
  104. TextDrawSetProportional(LMsg, 1);
  105. TextDrawSetSelectable(LMsg, 0);
  106.  
  107. Linharel = TextDrawCreate(512.000000, 202.000000, "-"); //Pronto
  108. TextDrawBackgroundColor(Linharel, 255);
  109. TextDrawFont(Linharel, 1);
  110. TextDrawLetterSize(Linharel, 10.710004, 1.000000);
  111. TextDrawColor(Linharel, 16711935);
  112. TextDrawSetOutline(Linharel, 1);
  113. TextDrawSetProportional(Linharel, 1);
  114. TextDrawSetSelectable(Linharel, 0);
  115.  
  116. Linharel1 = TextDrawCreate(512.000000, 122.000000, "-"); //Pronto
  117. TextDrawBackgroundColor(Linharel1, 255);
  118. TextDrawFont(Linharel1, 1);
  119. TextDrawLetterSize(Linharel1, 10.710004, 1.000000);
  120. TextDrawColor(Linharel1, 16711935);
  121. TextDrawSetOutline(Linharel1, 1);
  122. TextDrawSetProportional(Linharel1, 1);
  123. TextDrawSetSelectable(Linharel1, 0);
  124.  
  125. Linharel2 = TextDrawCreate(672.000000, 129.000000, "_"); //Pronto
  126. TextDrawBackgroundColor(Linharel2, 255);
  127. TextDrawFont(Linharel2, 1);
  128. TextDrawLetterSize(Linharel2, 1.790000, 8.500001);
  129. TextDrawColor(Linharel2, 16711935);
  130. TextDrawSetOutline(Linharel2, 1);
  131. TextDrawSetProportional(Linharel2, 1);
  132. TextDrawUseBox(Linharel2, 1);
  133. TextDrawBoxColor(Linharel2, 16711935);
  134. TextDrawTextSize(Linharel2, 635.000000, 47.000000);
  135. TextDrawSetSelectable(Linharel2, 0);
  136.  
  137. RelogioCentral = TextDrawCreate(528.000000, 154.000000, ""); //Pronto
  138. TextDrawBackgroundColor(RelogioCentral, 255);
  139. TextDrawFont(RelogioCentral, 1);
  140. TextDrawLetterSize(RelogioCentral, 0.629999, 1.900000);
  141. TextDrawColor(RelogioCentral, -1);
  142. TextDrawSetOutline(RelogioCentral, 1);
  143. TextDrawSetProportional(RelogioCentral, 1);
  144. TextDrawSetSelectable(RelogioCentral, 0);
  145.  
  146. RelogioD[0] = TextDrawCreate(545.000000, 135.000000, "1"); //Pronto
  147. TextDrawBackgroundColor(RelogioD[0], 255);
  148. TextDrawFont(RelogioD[0], 2);
  149. TextDrawLetterSize(RelogioD[0], 0.209999, 1.100000);
  150. TextDrawColor(RelogioD[0], -1);
  151. TextDrawSetOutline(RelogioD[0], 1);
  152. TextDrawSetProportional(RelogioD[0], 1);
  153. TextDrawSetSelectable(RelogioD[0], 0);
  154.  
  155. RelogioD[1] = TextDrawCreate(553.000000, 144.000000, "2"); //Pronto
  156. TextDrawBackgroundColor(RelogioD[1], 255);
  157. TextDrawFont(RelogioD[1], 2);
  158. TextDrawLetterSize(RelogioD[1], 0.209999, 1.100000);
  159. TextDrawColor(RelogioD[1], -1);
  160. TextDrawSetOutline(RelogioD[1], 1);
  161. TextDrawSetProportional(RelogioD[1], 1);
  162. TextDrawSetSelectable(RelogioD[1], 0);
  163.  
  164. RelogioD[2] = TextDrawCreate(558.000000, 160.000000, "3"); //Pronto
  165. TextDrawBackgroundColor(RelogioD[2], 255);
  166. TextDrawFont(RelogioD[2], 2);
  167. TextDrawLetterSize(RelogioD[2], 0.209999, 1.100000);
  168. TextDrawColor(RelogioD[2], -1);
  169. TextDrawSetOutline(RelogioD[2], 1);
  170. TextDrawSetProportional(RelogioD[2], 1);
  171. TextDrawSetSelectable(RelogioD[2], 0);
  172.  
  173. RelogioD[3] = TextDrawCreate(553.000000, 177.000000, "4"); //Pronto
  174. TextDrawBackgroundColor(RelogioD[3], 255);
  175. TextDrawFont(RelogioD[3], 2);
  176. TextDrawLetterSize(RelogioD[3], 0.209999, 1.100000);
  177. TextDrawColor(RelogioD[3], -1);
  178. TextDrawSetOutline(RelogioD[3], 1);
  179. TextDrawSetProportional(RelogioD[3], 1);
  180. TextDrawSetSelectable(RelogioD[3], 0);
  181.  
  182. RelogioD[4] = TextDrawCreate(545.000000, 189.000000, "5"); //Pronto
  183. TextDrawBackgroundColor(RelogioD[4], 255);
  184. TextDrawFont(RelogioD[4], 2);
  185. TextDrawLetterSize(RelogioD[4], 0.209999, 1.100000);
  186. TextDrawColor(RelogioD[4], -1);
  187. TextDrawSetOutline(RelogioD[4], 1);
  188. TextDrawSetProportional(RelogioD[4], 1);
  189. TextDrawSetSelectable(RelogioD[4], 0);
  190.  
  191. RelogioD[5] = TextDrawCreate(529.000000, 193.000000, "6"); //Pronto
  192. TextDrawBackgroundColor(RelogioD[5], 255);
  193. TextDrawFont(RelogioD[5], 2);
  194. TextDrawLetterSize(RelogioD[5], 0.209999, 1.100000);
  195. TextDrawColor(RelogioD[5], -1);
  196. TextDrawSetOutline(RelogioD[5], 1);
  197. TextDrawSetProportional(RelogioD[5], 1);
  198. TextDrawSetSelectable(RelogioD[5], 0);
  199.  
  200. RelogioD[6] = TextDrawCreate(512.000000, 189.000000, "7"); //Pronto
  201. TextDrawBackgroundColor(RelogioD[6], 255);
  202. TextDrawFont(RelogioD[6], 2);
  203. TextDrawLetterSize(RelogioD[6], 0.209999, 1.100000);
  204. TextDrawColor(RelogioD[6], -1);
  205. TextDrawSetOutline(RelogioD[6], 1);
  206. TextDrawSetProportional(RelogioD[6], 1);
  207. TextDrawSetSelectable(RelogioD[6], 0);
  208.  
  209. RelogioD[7] = TextDrawCreate(501.000000, 177.000000, "8"); //Pronto
  210. TextDrawBackgroundColor(RelogioD[7], 255);
  211. TextDrawFont(RelogioD[7], 2);
  212. TextDrawLetterSize(RelogioD[7], 0.209999, 1.100000);
  213. TextDrawColor(RelogioD[7], -1);
  214. TextDrawSetOutline(RelogioD[7], 1);
  215. TextDrawSetProportional(RelogioD[7], 1);
  216. TextDrawSetSelectable(RelogioD[7], 0);
  217.  
  218. RelogioD[8] = TextDrawCreate(497.000000, 160.000000, "9"); //Pronto
  219. TextDrawBackgroundColor(RelogioD[8], 255);
  220. TextDrawFont(RelogioD[8], 2);
  221. TextDrawLetterSize(RelogioD[8], 0.209999, 1.100000);
  222. TextDrawColor(RelogioD[8], -1);
  223. TextDrawSetOutline(RelogioD[8], 1);
  224. TextDrawSetProportional(RelogioD[8], 1);
  225. TextDrawSetSelectable(RelogioD[8], 0);
  226.  
  227. RelogioD[9] = TextDrawCreate(501.000000, 144.000000, "10"); //Pronto
  228. TextDrawBackgroundColor(RelogioD[9], 255);
  229. TextDrawFont(RelogioD[9], 2);
  230. TextDrawLetterSize(RelogioD[9], 0.209999, 1.100000);
  231. TextDrawColor(RelogioD[9], -1);
  232. TextDrawSetOutline(RelogioD[9], 1);
  233. TextDrawSetProportional(RelogioD[9], 1);
  234. TextDrawSetSelectable(RelogioD[9], 0);
  235.  
  236. RelogioD[10] = TextDrawCreate(514.000000, 135.000000, "11"); //Pronto
  237. TextDrawBackgroundColor(RelogioD[10], 255);
  238. TextDrawFont(RelogioD[10], 2);
  239. TextDrawLetterSize(RelogioD[10], 0.209999, 1.100000);
  240. TextDrawColor(RelogioD[10], -1);
  241. TextDrawSetOutline(RelogioD[10], 1);
  242. TextDrawSetProportional(RelogioD[10], 1);
  243. TextDrawSetSelectable(RelogioD[10], 0);
  244.  
  245. RelogioD[11] = TextDrawCreate(527.000000, 131.000000, "12"); //Pronto
  246. TextDrawBackgroundColor(RelogioD[11], 255);
  247. TextDrawFont(RelogioD[11], 2);
  248. TextDrawLetterSize(RelogioD[11], 0.209999, 1.100000);
  249. TextDrawColor(RelogioD[11], -1);
  250. TextDrawSetOutline(RelogioD[11], 1);
  251. TextDrawSetProportional(RelogioD[11], 1);
  252. TextDrawSetSelectable(RelogioD[11], 0);
  253.  
  254.  
  255. for(new t; t < 12; t++) format(RDstring[t], sizeof RDstring, "%d", t+1);
  256.  
  257. new Hora, Min, Segundo;
  258.  
  259. gettime(Hora, Min, Segundo);
  260.  
  261. if (Hora > 12) Hora -= 12;
  262.  
  263. if (Hora == 0) Hora = 12;
  264.  
  265. HTtimeR = Hora-1;
  266.  
  267. RelogioData();
  268.  
  269. //SetTimers
  270. SetTimer("RelogioData",60000,1);
  271.  
  272. SetTimer("RelogioDigital" ,1000, 1);
  273.  
  274. print("\n");
  275. print( " Ligado ");
  276. print( " Ligado ");
  277. print( " Ligado ");
  278. print( " Ligado ");
  279. print("\n");
  280.  
  281. return 1;
  282. }
  283.  
  284. public OnFilterScriptExit()
  285. {
  286. TextDrawDestroy( RelogioCentral);
  287.  
  288. TextDrawDestroy( RHoras);
  289. TextDrawDestroy( RDias);
  290. TextDrawDestroy( RInfo);
  291. TextDrawDestroy( LMsg);
  292. TextDrawDestroy( Linharel);
  293. TextDrawDestroy( Linharel1);
  294. TextDrawDestroy( Linharel2);
  295.  
  296. for(new t; t < 12; t++) TextDrawDestroy( RelogioD[ t ]);
  297. return 1;
  298. }
  299.  
  300. public OnPlayerSpawn(playerid)
  301. {
  302.  
  303. RelogioData();
  304. return 1;
  305. }
  306.  
  307.  
  308. public RelogioDigital(playerid)
  309. {
  310. new string[ 256 ];
  311.  
  312. new Horas, Minutos, Segundos;
  313.  
  314. new Anos, Meses, Dias;
  315.  
  316. // Get Time
  317. gettime(Horas,Minutos,Segundos);
  318.  
  319. getdate(Anos, Meses, Dias);
  320.  
  321. // Text Drawns Strings
  322. format( string, sizeof(string), "~w~Hora: %02d~g~:~w~%02d~g~:~w~%02d", Horas, Minutos, Segundos);
  323. TextDrawSetString( RHoras, string);
  324.  
  325. format(string, sizeof(string), "~w~Data: %02d~g~/~w~%d~g~/~w~%d", Dias, Meses, Anos);
  326. TextDrawSetString(RDias, string);
  327.  
  328. switch(Horas)
  329. {
  330.  
  331. case 0..5:
  332. {
  333.  
  334. format(string, sizeof(string), "~g~Madru");
  335. TextDrawSetString(LMsg, string);
  336. }
  337. //--
  338. case 6..11:
  339. {
  340.  
  341. format(string, sizeof(string), "~g~Manha");
  342. TextDrawSetString(LMsg, string);
  343. }
  344. //--
  345. case 12..17:
  346. {
  347.  
  348. format(string, sizeof(string), "~g~Tarde");
  349. TextDrawSetString(LMsg, string);
  350. }
  351. //--
  352. case 18..23:
  353. {
  354.  
  355. format(string, sizeof(string), "~g~Noite");
  356. TextDrawSetString(LMsg, string);
  357. }
  358. }
  359. return 1;
  360. }
  361.  
  362. public RelogioData()
  363. {
  364. new Ano,Mes;
  365.  
  366. new Dia,Hora;
  367.  
  368. new Min,Segundo;
  369.  
  370. new Rstring[ 5 ];
  371.  
  372. getdate(Ano, Mes, Dia); // Getendo Ano Mes e Dias!
  373. gettime(Hora, Min, Segundo); // Getando Horas e minutos e Segundos
  374.  
  375. TextDrawShowForAll( RHoras);
  376. TextDrawShowForAll( RDias);
  377. TextDrawShowForAll( RInfo);
  378. TextDrawShowForAll( Linharel);
  379. TextDrawShowForAll( Linharel1);
  380. TextDrawShowForAll( Linharel2);
  381. TextDrawShowForAll( LMsg);
  382. TextDrawShowForAll( RelogioCentral);
  383.  
  384. for(new l; l < 12; l++)
  385.  
  386. TextDrawShowForAll( RelogioD[ l ]);
  387.  
  388. if (Hora > 12) Hora -= 12;
  389.  
  390. if (Hora == 0) Hora = 12;
  391.  
  392. for(new l; l < 12; l++)
  393. {
  394.  
  395. if (Hora-1 == l)
  396.  
  397. {
  398.  
  399. // String Text DrawS!
  400. format(Rstring, sizeof Rstring, "~w~%s", Rstring[ HTtimeR ]);
  401.  
  402. TextDrawSetString(RelogioD[ HTtimeR ], Rstring);
  403.  
  404. TextDrawShowForAll(RelogioD[ HTtimeR ]);
  405.  
  406. // SetWorldTime(Hour); // Tire o > "//" > " Casou Queira Usar o SetWorldTime "
  407.  
  408. format( Rstring, sizeof Rstring, "~r~%d", l+1);
  409.  
  410. TextDrawSetString( RelogioD[ l ], Rstring);
  411.  
  412. TextDrawShowForAll( RelogioD[ l ]); HTtimeR = l;
  413.  
  414. break;
  415. }
  416. }
  417. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement