Raised This Month: $ Target: $400
 0% 

help with reduce damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
jo12a
Junior Member
Join Date: Apr 2005
Old 04-27-2005 , 02:52   help with reduce damage
Reply With Quote #1

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 ?
jo12a is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode