I made this plugin to increase the velocity of a weapon the entity_owner drops . and use register touch to do damage. but this wont allow me to drop any weapons . and theres no run time errors in my logs . any ideas ?
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
// Global Variables
new g_Throw;
public plugin_init()
{
register_plugin("Throw Weapons","0.1","The Specialist");
g_Throw = register_cvar("tw_switch","1");
register_clcmd("drop","throw_weapon");
register_touch("Ent","player","throw_damage");
}
public throw_weapon(id)
{
// if pcvar is off then end fucntion
if(get_pcvar_num(g_Throw)==0)
{
return PLUGIN_HANDLED;
}else{
new name[33];
get_user_name(id,name,32)
new index = get_user_index(name);
// find the weapon thrown by owner
new Ent = find_ent_by_owner(index ,"weapon",id);
// set the veocit yof the userrs weapon
entity_set_string(Ent,EV_VEC_velocity,"10000")
}
return PLUGIN_HANDLED;
}
public throw_damage(id)
{
// if user health is larger then damage then fakedamge
if(get_user_health(id) > 25 )
{
// deal fakedamge
fakedamage(id,"weapon_awp",float(read_data(2)),DMG_CLUB && DMG_BLAST )
return;
}else{
// if user has less health then he dies
user_kill(id);
}
return;
}