Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- 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"};
- new const szChud[3] = { 200, 200, 200 } // Можете задать цвет информера
- // Положение
- new const Float:szX = -1.0
- new const Float:szY = 0.05
- public plugin_init(){
- register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]);
- register_logevent("nice_ny_day_func", 2, "1=Round_Start");
- }
- public nice_ny_day_func(){
- szTime();
- nChatPrint(0, "^1[^4Nice New Year^1] До нового года осталось ^4%d^1 мес. ^4%d^1 нед. или ^4%d^1 дн.!", szMonth, szWeek, szDay);
- set_task(5.0, "nHud",0,_,_,"a",5);
- }
- public nHud(){
- szTime();
- set_hudmessage(szChud[0], szChud[1], szChud[2], szX, szY, 0, 0.0, 1.1, 0.0, 0.4, -1);
- show_hudmessage(0, "До нового года осталось %d мес. %d нед. или %d дн.!^n%d час. %d мин. %d сек.", szMonth, szWeek, szDay,szH,szMin,szSec);
- }
- public szTime(){
- get_time("%m", nMonth, 2);
- get_time("%U", nWeek, 2);
- get_time("%j", nDay, 3);
- get_time("%H", nH, 2);
- get_time("%M", nMin, 2);
- get_time("%S", nSec, 2);
- nMonth2 = str_to_num(nMonth);
- nWeek2 = str_to_num(nWeek);
- nDay2 = str_to_num(nDay);
- nH2 = str_to_num(nH);
- nMin2 = str_to_num(nMin);
- nSec2 = str_to_num(nSec);
- szMonth=(12 - nMonth2);
- szWeek=(52 - nWeek2);
- szDay=(365 - nDay2);
- szH=(24 - nH2);
- szMin=(60 - nMin2);
- szSec=(60 - nSec2);
- }
- stock nChatPrint(const id, const input[], any:...){
- new nCount = 1, nNum[32];
- static nMsgs[191];
- vformat(nMsgs, 190, input, 3);
- replace_all(nMsgs, 190, "!g", "^4");
- replace_all(nMsgs, 190, "!n", "^1");
- replace_all(nMsgs, 190, "!t", "^3");
- if(id) nNum[0] = id; else get_players(nNum, nCount, "ch")
- {
- for(new i = 0; i < nCount; i++){
- if(is_user_connected(nNum[i])){
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, nNum[i]);
- write_byte(nNum[i]);
- write_string(nMsgs);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment