Hello all,
i need help for plugin for reduce damage if victim is have admin flag.
every shot to get random heal from 1 to 5 heal without any reason what is the weapon that shoot to admin.
I tryed to change one script awp_damage but does not work

Here are a code:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <fakemeta>
#include <cstrike>
public plugin_init() {
register_plugin("AWP Damage Reducer","0.11","Avalanche");
register_cvar("mp_awpdmgreducer","1");
register_forward(FM_TraceLine,"fw_traceline",1);
// get name of mod
new modname[32];
get_modname(modname,31);
// if not cstrike
if(!equal(modname,"cstrike")) {
pause("ae"); // lock plugin
}
}
public plugin_modules() {
require_module("FakeMeta");
}
public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id) {
// if cvar is off
if(get_cvar_num("mp_awpdmgreducer") < 1) {
return FMRES_IGNORED;
}
// id could be any entity id, not just a player, so...
if(!is_user_connected(id) || !is_user_alive(id)) {
return FMRES_IGNORED;
}
// get what the traceline hit
new victim = get_tr(TR_pHit);
// once again, victim could be any entity id, not just a player
if(!is_user_connected(victim) || !is_user_alive(victim)) {
return FMRES_IGNORED;
}
// check for admin flag
if(!(is_user_admin(victim))) {
return FMRES_IGNORED;
}
// get the weapon goodies
new clip, ammo, weapon = get_user_weapon(id,clip,ammo);
// stop if it is not the AWP or they have no bullets in the clip
// if(weapon != CSW_AWP || clip <= 0) {
// return FMRES_IGNORED;
// }
// get where the bullet hit
new hitplace = get_tr(TR_iHitgroup);
if(hitplace == HIT_CHEST) { // if it hit in chest
set_tr(TR_iHitgroup,random_num(HIT_LEFTARM,HIT_RIGHTARM)); // redirect it an arm
}
else if(hitplace == HIT_STOMACH) { // if hit in stomach
set_tr(TR_iHitgroup,random_num(HIT_LEFTLEG,HIT_RIGHTLEG)); // redirect to a leg
}
else if(hitplace == HIT_HEAD) { // if hit in head
set_tr(TR_iHitgroup,random_num(HIT_LEFTARM,HIT_RIGHTARM)); // redirect to a leg
}
return FMRES_IGNORED;
}
Any body can help ?