Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Odliczanie
#1
Napisano 28.12.2009 12:15
#2
Napisano 28.12.2009 12:30
#include <amxmodx> #include <amxmisc> #include <cstrike> new const ny_time = 1262300400 // 00:00:00 1 styczen 2010 new c_info = 0 new const max_info = 100 public plugin_init() { register_plugin("New Year Countdown", "0.1", "Pavulon") set_task(1.0, "B4",777) } public B4() { new sek_left = ny_time - get_systime() if (sek_left>0) set_task(1.0, "countdown",0,_,_,"b") else pause("a") } public countdown() { new sek_left = ny_time - get_systime() if (sek_left<0) { remove_task(0) set_task(0.1,"ny_info", 999) return } new Time[128] format(Time, 127, "%s", timeleft(sek_left)) set_hudmessage(0, 0, 255, 0.020, 0.16, 0, 6.0, 1.0, 0.0, 0.0) ShowSyncHudMsg(0,CreateHudSyncObj(),"Do nowego roku pozostalo:^n%s",Time) } public ny_info() { if (c_info>max_info) return set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, -1.0, 0, 6.0, 0.1, 0.0, 0.0) ShowSyncHudMsg(0,CreateHudSyncObj(),"!!! SZCZESLIWEGO NOWEGO ROKU !!!^n!!! GL & HF !!!") c_info++ set_task(0.1,"ny_info", 999) } stock timeleft(sek_left) { new dni, godzin, minut, left = sek_left new Time[128], len = 0 if (left / 86400 >= 1) { dni = (left / 86400) left -= dni * 86400 len += format(Time[len], 127 -len, "%d d. ", dni) } if (left / 3600 >= 1) { godzin = (left / 3600) left -= godzin * 3600 len += format(Time[len], 127 -len, "%d godz. ", godzin) } if (left / 60 >= 1) { minut = (left / 60) left -= minut * 60 len += format(Time[len], 127 -len, "%d min. ", minut) } format(Time[len], 127 -len, "%d sek.", left) return Time }
IP: ts3.cserwerek.pl
#3
Napisano 28.12.2009 15:42
#4
Napisano 28.12.2009 17:14
#include <amxmisc>
#include <cstrike>
new const ny_time = 1262300400 // 00:00:00 1 styczen 2010 DATA
new c_info = 0
new const max_info = 100
public plugin_init()
{
register_plugin("New Year Countdown", "0.1", "Pavulon")
set_task(1.0, "B4",777)
}
public B4()
{
new sek_left = ny_time - get_systime()
if (sek_left>0)
set_task(1.0, "countdown",0,_,_,"b")
else
pause("a")
}
public countdown()
{
new sek_left = ny_time - get_systime()
if (sek_left<0)
{
remove_task(0)
set_task(0.1,"ny_info", 999)
return
}
new Time[128]
format(Time, 127, "%s", timeleft(sek_left))
set_hudmessage(0, 0, 255, 0.020, 0.16, 0, 6.0, 1.0, 0.0, 0.0)
ShowSyncHudMsg(0,CreateHudSyncObj(),"Do nowego roku pozostalo:^n%s",Time) Do nowego roku.... TYTUŁ
}
public ny_info()
{
if (c_info>max_info)
return
set_hudmessage(random_num(0,255), random_num(0,255), random_num(0,255), -1.0, -1.0, 0, 6.0, 0.1, 0.0, 0.0)
ShowSyncHudMsg(0,CreateHudSyncObj(),"!!! SZCZESLIWEGO NOWEGO ROKU !!!^n!!! GL & HF !!!") ŻYCZENIA
c_info++
set_task(0.1,"ny_info", 999)
}
stock timeleft(sek_left)
{
new dni, godzin, minut, left = sek_left
new Time[128], len = 0
if (left / 86400 >= 1)
{
dni = (left / 86400)
left -= dni * 86400
len += format(Time[len], 127 -len, "%d d. ", dni)
}
if (left / 3600 >= 1)
{
godzin = (left / 3600)
left -= godzin * 3600
len += format(Time[len], 127 -len, "%d godz. ", godzin)
}
if (left / 60 >= 1)
{
minut = (left / 60)
left -= minut * 60
len += format(Time[len], 127 -len, "%d min. ", minut)
}
format(Time[len], 127 -len, "%d sek.", left)
return Time
}
#5
Napisano 28.12.2009 18:24
#6
Napisano 29.12.2009 17:40
w php można skorzystać z funkcji PHP: mktime - Manual dla określenia ilości sekund w dowolnym momencie, ale w pawn'ie jest tylko możliwość pobrania aktualnej ilości sekund.
#7
Napisano 30.12.2009 20:07
Albo moglby ktos mi policzyć 31.12.2009 o godz 12:00 (W dzien)
#8
Napisano 30.12.2009 20:12
w php to po prostu:
//mktime(godz, min, sek, mies, dzien, rok);
echo mktime (12, 00, 00, 12, 31, 2009);
#9
Napisano 30.12.2009 20:52
/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 001: expected token: ";", but found "-identifier-"
/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 017: undefined symbol "Do"
/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 029: invalid expression, assumed zero
/groups/amxmodx/tmp3/textOEDmTl.sma(34) : fatal error 107: too many error messages on one line
Moglby mi ktos skomplikowac z ta data co podal Pavulon?
Użytkownik ToFFiK edytował ten post 30.12.2009 20:39
#10
Napisano 30.12.2009 21:05
Ja ci skompiluje jeżeli to nie przeszkodaThx, Portek wywala bledy przy komplikacji/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 001: expected token: ";", but found "-identifier-"/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 017: undefined symbol "Do"/groups/amxmodx/tmp3/textOEDmTl.sma(34) : error 029: invalid expression, assumed zero/groups/amxmodx/tmp3/textOEDmTl.sma(34) : fatal error 107: too many error messages on one lineMoglby mi ktos skomplikowac z ta data co podal Pavulon?
To co dał Portek + moja data
Załączone pliki
#11
Napisano 31.12.2009 10:03
Jak na razie dziala, odlicza THX za pomoc
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych