seroff

Nice New Year 1.5 By Seroff & sector

Dec 7th, 2017
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. new nMonth[3], nWeek[3], nDay[4],nH[3],nMin[3],nSec[3],nMonth2,nWeek2,nDay2,nH2,nMin2,nSec2,szMonth,szWeek,szDay,szH,szMin,szSec,PLUGIN[][]={"Nice New Year","1.5", "Seroff & sector"};
  4.  
  5. new const szChud[3] = { 200, 200, 200 } // Можете задать цвет информера
  6. // Положение
  7. new const Float:szX = -1.0
  8. new const Float:szY = 0.05
  9.  
  10. public plugin_init(){
  11. register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]);
  12. register_logevent("nice_ny_day_func", 2, "1=Round_Start");
  13. }
  14.  
  15. public nice_ny_day_func(){
  16. szTime();
  17. nChatPrint(0, "^1[^4Nice New Year^1] До нового года осталось ^4%d^1 мес. ^4%d^1 нед. или ^4%d^1 дн.!", szMonth, szWeek, szDay);
  18. set_task(5.0, "nHud",0,_,_,"a",5);
  19. }
  20.  
  21. public nHud(){
  22. szTime();
  23. set_hudmessage(szChud[0], szChud[1], szChud[2], szX, szY, 0, 0.0, 1.1, 0.0, 0.4, -1);
  24. show_hudmessage(0, "До нового года осталось %d мес. %d нед. или %d дн.!^n%d час. %d мин. %d сек.", szMonth, szWeek, szDay,szH,szMin,szSec);
  25. }
  26.  
  27. public szTime(){
  28. get_time("%m", nMonth, 2);
  29. get_time("%U", nWeek, 2);
  30. get_time("%j", nDay, 3);
  31. get_time("%H", nH, 2);
  32. get_time("%M", nMin, 2);
  33. get_time("%S", nSec, 2);
  34. nMonth2 = str_to_num(nMonth);
  35. nWeek2 = str_to_num(nWeek);
  36. nDay2 = str_to_num(nDay);
  37. nH2 = str_to_num(nH);
  38. nMin2 = str_to_num(nMin);
  39. nSec2 = str_to_num(nSec);
  40. szMonth=(12 - nMonth2);
  41. szWeek=(52 - nWeek2);
  42. szDay=(365 - nDay2);
  43. szH=(24 - nH2);
  44. szMin=(60 - nMin2);
  45. szSec=(60 - nSec2);
  46. }
  47.  
  48. stock nChatPrint(const id, const input[], any:...){
  49. new nCount = 1, nNum[32];
  50. static nMsgs[191];
  51. vformat(nMsgs, 190, input, 3);
  52. replace_all(nMsgs, 190, "!g", "^4");
  53. replace_all(nMsgs, 190, "!n", "^1");
  54. replace_all(nMsgs, 190, "!t", "^3");
  55. if(id) nNum[0] = id; else get_players(nNum, nCount, "ch")
  56. {
  57. for(new i = 0; i < nCount; i++){
  58. if(is_user_connected(nNum[i])){
  59. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, nNum[i]);
  60. write_byte(nNum[i]);
  61. write_string(nMsgs);
  62. message_end();
  63. }
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment