[JailBreak] Bunt więźniów (sekundy) - bunt...
lisek80
02.04.2012
Potrzebuję zrobić w tym pluginie żeby w HUD pisało : Do buntu pozostało 40/39 ... itd Kolor zielony
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "Jail Break: Bunt wiezniow - sekundy"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
new cvar_time
new Float:roundtime
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_time = register_cvar("jail_czasbuntu", "30")
register_logevent("round_start", 2, "1=Round_Start")
RegisterHam(Ham_TakeDamage, "player", "client_damage")
}
public round_start()
{
roundtime = get_gametime()
}
public client_damage(victim, entid, attacker, Float:damage, damagebits)
{
if(get_user_team(attacker) == 1 && get_user_team(victim) == 2)
{
static Float:nowtime, timer
nowtime = get_gametime()
timer = get_pcvar_num(cvar_time)
if((nowtime - roundtime) < float(timer))
{
client_print(attacker, print_chat, "Nie mozesz jeszcze rozpoczac buntu!")
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
Trikolo 02.04.2012
Czekaj zaraz zrobię
Użytkownik Trikolo edytował ten post 02.04.2012 16:22
Użytkownik Trikolo edytował ten post 02.04.2012 16:22
Trikolo 02.04.2012
Dzięki ziomuś
Takie pytanie czy podczas tego odliczania ma się coś dziac ? Np , że nie można zabic klawisza przez te 30 sec Czy nieśmiertelnośc dla klawisza przez te 30 sec (będzie trudniej )
lisek80
02.04.2012
Tak , chodzi mi wlasnie o to że CT jest przez te 30 secund nietykalny
To jak zrobisz ? )
To jak zrobisz ? )
Trikolo 02.04.2012
Masz :
Jak nie będzie działac to pisz .
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fun> #include <hamsandwich> #define PLUGIN "HUD Timer + niesmiertelnosc" #define VERSION "1.0" #define AUTHOR "Trikolo" new Odliczanie[33] public plugin_init() { register_plugin("PLUGIN","VERSION" ,"AUTHOR" ) RegisterHam(Ham_Spawn, "player", "gracz_spawn", 1); } public gracz_spawn(id) { set_hudmessage(0, 255, 0, 0.03, 0.76, 2, 0.02, 1.0, 0.01) show_hudmessage(0, "Za 30 sec mozna bedzie rozpoczac bunt !", Odliczanie) if(get_user_team(id) == 1) { client_print(id,print_chat,"Masz niesmiertelnosc") set_user_godmode(id,1) if(task_exists(id)){ change_task(id,30.0) } else{ set_task(30.0, "PowerOFF", id) } } } public PowerOFF(id) { client_print(id,print_chat,"Tracisz niesmiertelnosc") set_user_godmode(id,0) }(Nie testowałem) Bez odliczania ale hud pokazuje za ile można rozpocząc bunt
Jak nie będzie działac to pisz .
Trikolo 02.04.2012
od razu Ci mogę powiedzieć, że działać nie będzie
Hud może nie ale ochrona ct przez 30 sec tak
Misiaczek ;c
03.04.2012
sprawdź
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#define PLUGIN "Jail Break: Bunt wiezniow - sekundy"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"
new cvar_time
new Float:roundtime
new g_msgsync;
new countdown_timer
const TASK_ID = 1603;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_time = register_cvar("jail_czasbuntu", "30")
register_logevent("round_start", 2, "1=Round_Start")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
RegisterHam(Ham_TakeDamage, "player", "client_damage")
g_msgsync = CreateHudSyncObj();
}
public round_start()
{
roundtime = get_gametime()
}
public event_round_start()
{
remove_task(TASK_ID);
countdown_timer = get_cvar_num("jail_czasbuntu") - 1;
set_task(4.0, "countdown", TASK_ID);
}
public countdown()
{
if (countdown_timer > 1)
{
set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10);
if (countdown_timer != 1)
ShowSyncHudMsg(0, g_msgsync, "Do buntu pozostało %i", countdown_timer-1);
}
--countdown_timer;
if(countdown_timer >= 1)
set_task(1.0, "countdown", TASK_ID);
else
remove_task(TASK_ID);
}
public client_damage(victim, entid, attacker, Float:damage, damagebits)
{
if(get_user_team(attacker) == 1 && get_user_team(victim) == 2)
{
static Float:nowtime, timer
nowtime = get_gametime()
timer = get_pcvar_num(cvar_time)
if((nowtime - roundtime) < float(timer))
{
client_print(attacker, print_chat, "Nie mozesz jeszcze rozpoczac buntu!")
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}
lisek80
03.04.2012
Czy możesz zrobić to trochę większ i kolor ZIELONY i jeszcze tylko żeby to było tak po lewej stronie dolnej ekranu.
` Paciu ;*
01.05.2014
Wie ktoś jak przerobić aby było 60 sekund a nie 30 ? Bo ja ustawiam w
cvar_time = register_cvar("jail_czasbuntu", "30")
z 30 s na 60 s i kompiluje to i tak jest 30...