| drumzplaya13 |
11-04-2009 19:59 |
camera view
With this code you can view 1st person inside of nades,flashes, and smokes.
PHP Code:
#include <amxmodx> #include <engine>
#define PLUGIN "Steer nades" #define VERSION "1.4" #define AUTHOR "NL)Ramon(NL"
new bool:isgren[33] new whosgren[33]
new grencam, gravgren, smokecam, grenexpl
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_event("DeathMsg","dead","a") grencam = register_cvar("amx_grencam","1") smokecam = register_cvar("amx_grensmoke","0") gravgren = register_cvar("amx_grengrav","0") grenexpl = register_cvar("amx_grenexplode","1") }
public dead(){ new id = read_data(2) isgren[id] = false attach_view(id,id) whosgren[id] = 0 }
public grenade_throw(id,grenid,grentype) { if(get_pcvar_num(grencam) <= 0 || is_user_bot(id) || !is_user_alive(id)) return PLUGIN_CONTINUE if(get_pcvar_num(smokecam) <= 0 && grentype == 9) return PLUGIN_CONTINUE if(grenid <= 0) { isgren[id] = false return PLUGIN_CONTINUE } if(get_pcvar_num(grenexpl)) { client_cmd(id,"weapon_knife") client_print(id,print_chat,"Press attack ( mouse 1 ) to let the grenade explode.") } isgren[id] = true whosgren[id] = grenid attach_view(id,grenid) return PLUGIN_CONTINUE }
public client_PreThink(id){ if(!isgren[id] || !is_user_alive(id)) return PLUGIN_CONTINUE if(!is_valid_ent(whosgren[id])) { isgren[id] = false attach_view(id,id) whosgren[id] = 0 return PLUGIN_CONTINUE } if(get_pcvar_num(grenexpl) && get_user_button(id) & IN_ATTACK) { entity_set_float(whosgren[id], EV_FL_dmgtime, get_gametime() - 7) return PLUGIN_CONTINUE } attach_view(id,whosgren[id]) new Float:angles[3] entity_get_vector(id,EV_VEC_v_angle,angles) new Float:setvel[3] velocity_by_aim(id,get_speed(whosgren[id]),setvel) if(get_pcvar_num(gravgren)) { new Float:vel[3] entity_get_vector(whosgren[id],EV_VEC_velocity,vel) setvel[2] = vel[2] } entity_set_vector(whosgren[id],EV_VEC_velocity,setvel) entity_set_vector(whosgren[id],EV_VEC_angles,angles) return PLUGIN_CONTINUE }
I am wondering if someone can take out the explosion of the nades, flashes and smokes, and make it so it travels till it hits the ground, meaning you can throw it as far as you can but the nades dont explode they disappear when they hit the ground but when they hit the ground it goes back to the 1st person view of the player.
|