#include #include #include #include #include #include #define DMG_BULLET (1<<1) /*****KONFIGURACJA*****/ #define COLORCHAT #define PREMIUM #define PREDKOSC 340 #define MAX_PALIWO 60 #define WSPOLCZYNNIK_PALIWA 0.1 #define CO_ILE_TANKOWANIE 0.3 #define CO_ILE_SPALANIE 0.1 /*****KONFIGURACJA*****/ /*#define TASK_SPALANIE 666 #define TASK_TANKOWANIE 999*/ #if defined COLORCHAT #include #endif new smoke; new bool:has_jp[33]; new bool:has_started; new frame[33]; new paliwo[33]; new max_paliwo[33]; new bool:ma_klase[33]; new const nazwa[] = "Jetpack (MEGA PREMIUM)"; new const opis[] = "Ma Jetpack (plecak odrzutowy), dodatkowe 25% obrazen z kazdej broni"; new const bronie = (1< 0) { new Float:fAim[3] , Float:fVelocity[3]; VelocityByAim(id , PREDKOSC, fAim); fVelocity[0] = fAim[0]; fVelocity[1] = fAim[1]; fVelocity[2] = fAim[2]; set_user_velocity(id , fVelocity); entity_set_int(id , EV_INT_gaitsequence , 6); emit_sound(id , CHAN_VOICE , "QTM_CodMod/jetpack.wav" , 1.0 , ATTN_NORM , 0 , PITCH_NORM); if(frame[id] >= 3) { frame[id] = 0; smoke_effect(id); entity_set_string(id , EV_SZ_weaponmodel , "models/p_egon.mdl"); } frame[id]++; SprawdzSpalanie(id) } else { client_print(id, print_center, "Skonczylo Ci sie paliwo! Automatycznie zdjales Jetpack!"); has_jp[id] = false; SprawdzTankowanie(id) } } else { SprawdzTankowanie(id) } return FMRES_IGNORED; } public UpdateClientData_Post(id, sendweapons, cd_handle) { if(!is_user_connected(id)) { return FMRES_IGNORED; } if(!is_user_alive(id)) { return FMRES_IGNORED; } if(!ma_klase[id]) { return FMRES_IGNORED; } if(has_jp[id]) { set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001 ); } return FMRES_HANDLED; } public fwd_CmdStart(id, uc_handle, seed) { if(!is_user_connected(id)) { return FMRES_IGNORED; } if(!is_user_alive(id)) { return FMRES_IGNORED; } if(!ma_klase[id]) { return FMRES_IGNORED; } new buttons = get_uc(uc_handle, UC_Buttons) new oldbuttons = get_user_oldbutton(id); if((buttons & IN_ATTACK) || !(oldbuttons & IN_ATTACK)) { return FMRES_IGNORED; } if(has_jp[id]) { set_uc(uc_handle, UC_Buttons, buttons & ~IN_ATTACK); return FMRES_HANDLED; } return FMRES_IGNORED; } public SprawdzSpalanie(id) { if(paliwo[id] > 0) { static Float:Last[33]; new Float:Now = get_gametime(); if((Now - Float:Last[id]) >= CO_ILE_SPALANIE) { Spalanie(id); Last[id] = Now; } } } public SprawdzTankowanie(id) { if(paliwo[id] < MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round)) { static Float:Last[33]; new Float:Now = get_gametime(); if((Now - Float:Last[id]) >= CO_ILE_TANKOWANIE) { Tankowanie(id); Last[id] = Now; } } } public Spalanie(id) { paliwo[id]--; } public Tankowanie(id) { paliwo[id]++; } public CurWeapon(id) { //new weapon = read_data(2); if(ma_klase[id]) //tutaj wstawiamy ma_klase lub ma_perk { if(has_jp[id]) //tutaj ustawiamy broń, jakiej model będziemy zmieniać { set_pev(id, pev_viewmodel2, "models/v_egon.mdl") set_pev(id, pev_weaponmodel2, "models/p_egon.mdl") } } } public smoke_effect(id) { new origin[3]; get_user_origin(id, origin, 0); origin[2] = origin[2] - 10; message_begin(MSG_BROADCAST, SVC_TEMPENTITY); write_byte(17); write_coord(origin[0]); write_coord(origin[1]); write_coord(origin[2]); write_short(smoke); write_byte(10); write_byte(115); message_end(); } public JetPackOn(id) { if(!ma_klase[id]) { return PLUGIN_HANDLED; } if(!is_user_alive(id)) { client_print(id , print_center , "Nie mozesz zalozyc plecaka gdy nie zyjesz!"); return PLUGIN_HANDLED; } if(has_jp[id]) { client_print(id , print_center , "Masz juz ubrany Jetpack!"); return PLUGIN_HANDLED; } has_jp[id] = true; client_print(id , print_center , "Ubrales Jetpack! By go uzyc trzymaj klawisz skoku i kieruj myszka"); emit_sound(id , CHAN_VOICE , "items/gunpickup2.wav" , 1.0 , ATTN_NORM , 0 , PITCH_NORM); return PLUGIN_HANDLED; } public JetPackOff(id) { if(!ma_klase[id]) { return PLUGIN_HANDLED; } if(!has_jp[id]) { client_print(id , print_center , "Nie masz ubranego Jetpacka!"); return PLUGIN_HANDLED; } client_print(id , print_center , "Zdjeles Jetpack!"); has_jp[id] = false; return PLUGIN_HANDLED; } public did_not_start() { has_started = false; new aPlayers[32] , iNum , i; get_players(aPlayers, iNum); for(i = 1; i <= iNum; i++) { has_jp[aPlayers[i]] = false; } new ent = -1; while((ent = find_ent_by_class(ent , "jetpack")) != 0) { remove_entity(ent); } } public did_start() { has_started = true; } public client_connect(id) { has_jp[id] = false; } public client_disconnect(id) { has_jp[id] = false; } public PobierzIlosc(id) { if(ma_klase[id]) return paliwo[id]; return 0; } public PobierzIloscMax(id) { if(ma_klase[id]) return MAX_PALIWO+floatround((cod_get_user_intelligence(id, 1, 1, 1)*WSPOLCZYNNIK_PALIWA), floatround_round); return 0; } public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits) { if(!is_user_connected(idattacker)) return HAM_IGNORED; if(!ma_klase[idattacker]) return HAM_IGNORED; if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits); if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_M4A1 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits); if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_SG552 && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits); if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_DEAGLE && damagebits & DMG_BULLET) cod_inflict_damage(idattacker, this, 25.0, 0.0, idinflictor, damagebits); return HAM_IGNORED; } /* ****************************** * END OF FILE ****************************** */ ////////////////////////////