Imi puteti modifica pluginul de mai jos sa execute miscarea cand apas pe tasta C in loc de tasta E ?
- | Afiseaza codul
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <fakemeta_util> #include <hamsandwich> #include <engine> #include <cstrike> #include <zombieplague> #define PLUGIN "[CSO] Foot Kick" #define VERSION "0.0.1.4" #define AUTHOR "PlaneShift1231" #define gModels "models/cso/v_foot.mdl" new const gSounds[][] = { "cso/foot_slash.wav", "cso/foot_kick.wav" } ; new bool: gFootKick[33] ; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) ; RegisterHam(Ham_Player_PreThink, "player", "PlayerPreThink") ; } public plugin_precache() { precache_sound(gSounds[0]) ; precache_sound(gSounds[1]) ; precache_model(gModels) ; } public FootKick(id) { if( !zp_get_user_zombie(id) && is_user_alive(id) && get_pdata_float(id, 83) <= 0.0 && !(pev(id, pev_flags) & FL_DUCKING) ) { set_pev(id, pev_velocity, {0.0}) ; set_pev(id, pev_viewmodel2, gModels) ; PlayAnimation(id, 1) ; set_pdata_float(id, 83, 0.6) ; gFootKick[id] = true ; new Target, Body ; get_user_aiming(id, Target, Body, 100) ; if( Target && is_user_alive(Target) && zp_get_user_zombie(Target) ) { new Float: fVelocity[3] ; velocity_by_aim(id, 500, fVelocity) ; fVelocity[2] = 300.0 ; set_pev(Target, pev_velocity, fVelocity) ; } if( AimDistance(id) <= 100 || is_user_alive(Target) ) { emit_sound(id, CHAN_WEAPON, gSounds[1], 1.0, ATTN_NORM, 0, PITCH_NORM) ; } else emit_sound(id, CHAN_WEAPON, gSounds[0], 1.0, ATTN_NORM, 0, PITCH_NORM) ; } return PLUGIN_HANDLED ; } public PlayerPreThink(id) { static Float: NextAttack ; NextAttack = get_pdata_float(id, 83, 5) ; if( NextAttack >= 0.0 && gFootKick[id] ) { set_pev(id, pev_velocity, {0.0,0.0,0.0}) ; } if( NextAttack <= 0.0 && gFootKick[id] ) { static Weapon ; Weapon = get_pdata_cbase(id, 373) ; if(pev_valid(Weapon)) { ExecuteHamB(Ham_Item_Deploy, Weapon) ; gFootKick[id] = false ; } } new Button = get_user_button(id) ; if( Button & IN_USE ) { FootKick(id) ; } } stock Float: AimDistance(id) { static a, Float:b ; return get_user_aiming(id, a, _:b) ; } stock PlayAnimation(const Player, const Sequence) { set_pev(Player, pev_weaponanim, Sequence) ; message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player) ; write_byte(Sequence) ; write_byte(pev(Player, pev_body)) ; message_end() ; }