#include #include #include #include #include #include #include #define TIME 5.0 #define UNIKAT 2013 new const TXT[] = "Pasek naladowany"; // zmianiasz tekst po naladowaniu :) new const nazwa[] = "Ninja"; new const opis[] = ""; new const bronie = 0; new const zdrowie = 0; new const kondycja = 0; new const inteligencja = 0; new const wytrzymalosc = 0; new bool:ma_klase[33]; new bool:g_loaded[33] new msgBarTime; public plugin_init() { register_plugin(nazwa, "1.0", "amxx.pl"); cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc); RegisterHam(Ham_Spawn, "player", "fwSpawn_Grawitacja", 1); register_event("CurWeapon","CurWeapon","be", "1=1"); msgBarTime = get_user_msgid("BarTime"); } public cod_class_enabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 15); entity_set_float(id, EV_FL_gravity, 200.0/800.0); ma_klase[id] = true; } public cod_class_disabled(id) { set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255); entity_set_float(id, EV_FL_gravity, 1.0); ma_klase[id] = false; } public CurWeapon(id) { if ((get_user_weapon(id) != CSW_C4) && (get_user_weapon(id) != CSW_KNIFE) && (ma_klase[id])) { client_cmd(id,"weapon_knife") engclient_cmd(id,"weapon_knife") } } public fwSpawn_Grawitacja(id) { if(ma_klase[id]) entity_set_float(id, EV_FL_gravity, 200.0/800.0); } public client_PreThink(id) { new clip, ammo new weapon = get_user_weapon(id, clip, ammo) new button2 = get_user_button(id); if(ma_klase[id] & 524288 == 524288) { if(!(is_user_moving(id)) && get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)))) { if(!g_loaded[id]) { if(weapon == 29) { if(!task_exists(id+UNIKAT)) { new data[1]; data[0] = id; bartime(id, floatround(TIME)) set_task(TIME, "set_invisible", id+UNIKAT, data, 1) } } else { if(task_exists(id+UNIKAT)) { remove_task(id+UNIKAT); bartime(id, 0); } g_loaded[id] = false; set_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255); } } } } } public set_invisible(data[]) { new id = data[0]; set_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 25); set_hudmessage(255, 255, 0, -1.0, 0.2, 0, 6.0, 3.0) show_hudmessage(id, TXT) g_loaded[id] = true; } stock bartime(id, czas) { message_begin(MSG_ONE_UNRELIABLE, msgBarTime, .player = id); write_short(czas); message_end(); } stock bool:is_user_moving(id) { new Float:fVelocity[3]; pev(id, pev_velocity, fVelocity); if(fVelocity[0] != 0.0 || fVelocity[1] != 0.0 || fVelocity[2] != 0.0) return true; return false; }