/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta_util>
#define PLUGIN "DeathRun Rozgrzewka"
#define VERSION "1.0"
#define AUTHOR "Suis"
#define SPRAWDZ 3431
#define prefix "[Prefix]"
new Odliczanie[33]
new rr_czas
new bool:noze = false
new const muzyka[]= "misc/rozgrzewka/nuta.mp3"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("TextMsg","nozowka","a","2&#Game_C")
rr_czas = register_cvar("rr_czas","90")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_event("DeathMsg","death_msg","a")
}
public nozowka(id)
{
set_task(1.0, "Start")
}
public Start(id)
{
client_cmd(0,"mp3 play sound/%s", muzyka)
fm_set_user_gravity ( id, float ( 400 / 800 ) );
switchweapon(id)
noze = true
Odliczanie[id] = get_pcvar_num(rr_czas);
if(task_exists(id + SPRAWDZ))
{
remove_task( id + SPRAWDZ )
}
set_task( 1.0, "Koniec", id + SPRAWDZ, _, _, "b" )
return PLUGIN_CONTINUE
}
public Koniec(task_id)
{
new id = task_id - SPRAWDZ
set_hudmessage( 80, 0, 255, 0.03, 0.76, 2, 0.02, 1.0, 0.01 )
show_hudmessage( id, "%s ^nKoniec rundy nozowej za: %d", prefix, Odliczanie[id] )
Odliczanie[id] -= 1
if(Odliczanie[id] <= 0)
{
if( task_exists(task_id) )
{
remove_task( task_id )
}
set_cvar_num("sv_restart", 2);
ColorChat(id, RED, "%s^x04 Powodzenia i wysokich lotow!", prefix);
noze = false
}
}
public switchweapon(id)
{
if (!noze)
return PLUGIN_CONTINUE
engclient_cmd(id,"weapon_knife")
return PLUGIN_CONTINUE
}
public death_msg()
{
if(!noze)
return
new id = read_data(2)
set_task(1.0,"respawn_player",id)
}
public respawn_player(id)
{
if(is_user_connected(id))
ExecuteHamB(Ham_CS_RoundRespawn, id)
}
public plugin_precache() precache_sound(muzyka)
Ścieżkę do nuty dajesz w
new const muzyka[]= "misc/rozgrzewka/nuta.mp3"
Musi być w mp3
Cvary
rr_czas
Czas rozgrzewki w sekundach