←  Szukam pluginu

AMXX.pl: Support AMX Mod X i SourceMod

»

Noz 1/1 plecy

  • +
  • -
MistrzFlesha's Photo MistrzFlesha 16.03.2015

Szukam pluginu, który daje 1/1 na zabicie z noza jezeli przeciwnik jest odwrocony tak jak w cs:go.
Dodatkowo jesli by sie dalo ze gdy gramy z PodBotami na serwerze to botom nie daje bomby.
Quote

  • +
  • -
ZjadaczPasztetow's Photo ZjadaczPasztetow 16.03.2015

W 1.6 też jest 1/1. Z tego co pamiętam to 195hp ;)
Quote

  • +
  • -
NieWiemMamMac@'s Photo NieWiemMamMac@ 16.03.2015

Można tak:

Ale jak Zjadacz napisał, w 1.6 uderzenie nożem w plecy zabiera 195 hp. 

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <cstrike>

#define PLUGIN "KOSA 1/1"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
}

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
    if(!is_user_connected(idattacker))
        return HAM_IGNORED;
        
    if(UTIL_In_FOV(idattacker, this) && !UTIL_In_FOV(this, idattacker) && get_pdata_float(get_pdata_cbase(idattacker,373,5),47,4) > 1.0)
    {
        cs_set_user_armor(this, 0, CS_ARMOR_NONE);
        SetHamParamFloat(4, float(get_user_health(this) + 1));
    }
        
    return HAM_IGNORED;
}

stock bool:UTIL_In_FOV(id,target)
{
    if (Find_Angle(id,target,9999.9) > 0.0)
        return true;
    
    return false;
}

stock Float:Find_Angle(Core,Target,Float:dist)
{
    new Float:vec2LOS[2];
    new Float:flDot;
    new Float:CoreOrigin[3];
    new Float:TargetOrigin[3];
    new Float:CoreAngles[3];
    
    pev(Core,pev_origin,CoreOrigin);
    pev(Target,pev_origin,TargetOrigin);
    
    if (get_distance_f(CoreOrigin,TargetOrigin) > dist)
        return 0.0;
    
    pev(Core,pev_angles, CoreAngles);
    
    for ( new i = 0; i < 2; i++ )
        vec2LOS[i] = TargetOrigin[i] - CoreOrigin[i];
    
    new Float:veclength = Vec2DLength(vec2LOS);
    
    //Normalize V2LOS
    if (veclength <= 0.0)
    {
        vec2LOS[0] = 0.0;
        vec2LOS[1] = 0.0;
    }
    else
    {
        new Float:flLen = 1.0 / veclength;
        vec2LOS[0] = vec2LOS[0]*flLen;
        vec2LOS[1] = vec2LOS[1]*flLen;
    }
    
    //Do a makevector to make v_forward right
    engfunc(EngFunc_MakeVectors,CoreAngles);
    
    new Float:v_forward[3];
    new Float:v_forward2D[2];
    get_global_vector(GL_v_forward, v_forward);
    
    v_forward2D[0] = v_forward[0];
    v_forward2D[1] = v_forward[1];
    
    flDot = vec2LOS[0]*v_forward2D[0]+vec2LOS[1]*v_forward2D[1];
    
    if ( flDot > 0.5 )
    {
        return flDot;
    }
    
    return 0.0;
}

stock Float:Vec2DLength( Float:Vec[2] )  
{
    return floatsqroot(Vec[0]*Vec[0] + Vec[1]*Vec[1] );
}

Edited by NieWiemMamMac@, 16.03.2015 21:38.
Quote