1. sayfa (Toplam 1 sayfa)

Basit istek

Gönderilme zamanı: Pzt Eki 25, 2021 8:37 pm
gönderen ERRA
Selamlar millet şu eklentiyi

Kod: Tümünü seç

#include < amxmodx >
#include < fakemeta_util >
#include < hamsandwich >

#define MAX_CLIENTS   32
#define WEAPON        get_user_weapon
#define SHOTGUN     ( WEAPON ( id ) == CSW_M3 || WEAPON ( id ) == CSW_XM1014 )
#define num           get_pcvar_num
#define ALIVE         is_user_alive

new   g_pcvar_a_realism
	, g_pcvar_a_shotguns_accuracy
	, g_pcvar_a_recoil
	, g_pcvar_a_cross_snipers
	, g_pcvar_a_standard_cross
	, g_pcvar_a_static_cross
	, g_pcvar_a_standard_cross_spec
	, g_pcvar_a_static_cross_spec
	, g_pcvar_a_snipers_cross_spec
	, target , body , bool: FLASHED
	, bool: ON_SCOPE [ MAX_CLIENTS + 1 ]

public plugin_init ( )
{
	register_plugin                               ( "Aim Realism"                 , "2.2.5"     , "WATCH_DOGS UNITED" )
	g_pcvar_a_realism             = register_cvar ( "aim__realism"                ,     "1"                           )
	g_pcvar_a_shotguns_accuracy   = register_cvar ( "aim__shotguns_accuracy"      ,  "2020"                           )
	g_pcvar_a_recoil              = register_cvar ( "aim__recoil"                 ,     "0.237"                       )
	g_pcvar_a_standard_cross      = register_cvar ( "aim__standard_crosshair"     ,     "0"                           )
	g_pcvar_a_static_cross        = register_cvar ( "aim__static_crosshair"       ,     "0"                           )
	g_pcvar_a_cross_snipers       = register_cvar ( "aim__snipers_crosshair"      ,     "0"                           )
	g_pcvar_a_standard_cross_spec = register_cvar ( "aim_standard_cross_spec"     ,     "0"                           )
	g_pcvar_a_static_cross_spec   = register_cvar ( "aim_static_cross_spec"       ,     "0"                           )
	g_pcvar_a_snipers_cross_spec  = register_cvar ( "aim_snipers_cross_spec"      ,     "0"                           )
	register_forward                              ( FM_TraceLine , "fwTraceLine"  ,      1                            )
	register_event                                ( "SetFOV"     , "Event_SetFOV" ,     "b"                           )
	register_event                                ( "CurWeapon"  , "Cross_Mode"   ,     "b"     , "1=1"               )

	static szWeaponName [ 32 ] , NOSHOT_BITSUM = ( 1<<CSW_KNIFE ) | ( 1<<CSW_HEGRENADE ) | ( 1<<CSW_FLASHBANG ) | ( 1<<CSW_SMOKEGRENADE )
	for ( new iId = CSW_P228; iId <= CSW_P90; iId++ )
	{
		if ( ~NOSHOT_BITSUM & 1<<iId && get_weaponname ( iId , szWeaponName , charsmax ( szWeaponName ) ) )
			RegisterHam ( Ham_Weapon_PrimaryAttack , szWeaponName , "Recoil_Control" , 1 )
	}
}

public grenade_throw ( id , grenadeIndex , weaponId )
{
	if ( num ( g_pcvar_a_realism ) && weaponId == CSW_FLASHBANG )
	{
		set_task ( 1.5 , "Generic_Flashed" )
		set_task ( 1.7 , "Generic_No_Flashed" )
	}
}

public Generic_Flashed ( )

	FLASHED = true

public Generic_No_Flashed ( )

	FLASHED = false

public fwTraceLine ( const Float: start [ 3 ] , Float: dest [ 3 ] , HITZONE , id , ptr )
{
	if ( !num    ( g_pcvar_a_realism )
	||   !ALIVE  ( id )
	||    HITZONE       != DONT_IGNORE_MONSTERS
	||    WEAPON ( id ) == CSW_KNIFE )
	return

	static button; button = pev ( id , pev_button )

	if ( button && IN_ATTACK && FLASHED != true )
	{
		if ( !SHOTGUN )
		{
			velocity_by_aim ( id , 9999 , dest )
			xs_vec_add ( start , dest , dest )
		}

		if ( SHOTGUN && get_user_aiming ( id , target , body , 2000 ) && target )
		{
			velocity_by_aim ( id , num ( g_pcvar_a_shotguns_accuracy ) , dest )
			xs_vec_add ( start , dest , dest )
		}

		engfunc ( EngFunc_TraceLine , start , dest , HITZONE , id , ptr )
	}
}

public Recoil_Control ( ent , Float: push [ 3 ] )
{
	if ( num ( g_pcvar_a_realism ) )
	{
		new id = pev ( ent , pev_owner )
		pev ( id , pev_punchangle , push )
		xs_vec_mul_scalar ( push , get_pcvar_float ( g_pcvar_a_recoil ) , push )
		set_pev ( id , pev_punchangle , push )
	}
}

public Event_SetFOV ( id )

	ON_SCOPE [ id ] = ( read_data ( 1 ) < 55 )

public Cross_Mode ( id )
{
	if ( !ON_SCOPE [ id ] )
	{
		new SNIPER = WEAPON ( id ) == CSW_G3SG1
				  || WEAPON ( id ) == CSW_SCOUT
				  || WEAPON ( id ) == CSW_SG550 , CM = 64

		if ( num ( g_pcvar_a_standard_cross      ) &&  ALIVE ( id )
		||   num ( g_pcvar_a_standard_cross_spec ) && !ALIVE ( id ) )
			 CM =  0

		message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "HideWeapon" ) ,_, id ); write_byte ( CM ); message_end

		if ( ALIVE ( id ) && num ( g_pcvar_a_static_cross       ) && !SNIPER
		||   ALIVE ( id ) && num ( g_pcvar_a_cross_snipers      ) &&  SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_static_cross_spec  ) && !SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_snipers_cross_spec ) &&  SNIPER ) {
			 message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "Crosshair" ) , { 0 , 0 , 0 } , id ); write_byte ( 1 ); message_end
		}
	}
}
bu nativeyi ve kullanım amaçlı lvl ifini koda bir türlü entegere edemedim yardım eder misiniz.

Kod: Tümünü seç

native crxranks_get_user_level(index);

Kod: Tümünü seç

if(crxranks_get_user_level(iAttacker) != 33)

Basit istek

Gönderilme zamanı: Pzt Eki 25, 2021 9:07 pm
gönderen orucoglukayra
Deneyin ;

Kod: Tümünü seç

#include < amxmodx >
#include < fakemeta_util >
#include < hamsandwich >

native crxranks_get_user_level(index);

#define MAX_CLIENTS   32
#define WEAPON        get_user_weapon
#define SHOTGUN     ( WEAPON ( id ) == CSW_M3 || WEAPON ( id ) == CSW_XM1014 )
#define num           get_pcvar_num
#define ALIVE         is_user_alive

new   g_pcvar_a_realism
	, g_pcvar_a_shotguns_accuracy
	, g_pcvar_a_recoil
	, g_pcvar_a_cross_snipers
	, g_pcvar_a_standard_cross
	, g_pcvar_a_static_cross
	, g_pcvar_a_standard_cross_spec
	, g_pcvar_a_static_cross_spec
	, g_pcvar_a_snipers_cross_spec
	, target , body , bool: FLASHED
	, bool: ON_SCOPE [ MAX_CLIENTS + 1 ]

public plugin_init ( )
{
	register_plugin                               ( "Aim Realism"                 , "2.2.5"     , "WATCH_DOGS UNITED" )
	g_pcvar_a_realism             = register_cvar ( "aim__realism"                ,     "1"                           )
	g_pcvar_a_shotguns_accuracy   = register_cvar ( "aim__shotguns_accuracy"      ,  "2020"                           )
	g_pcvar_a_recoil              = register_cvar ( "aim__recoil"                 ,     "0.237"                       )
	g_pcvar_a_standard_cross      = register_cvar ( "aim__standard_crosshair"     ,     "0"                           )
	g_pcvar_a_static_cross        = register_cvar ( "aim__static_crosshair"       ,     "0"                           )
	g_pcvar_a_cross_snipers       = register_cvar ( "aim__snipers_crosshair"      ,     "0"                           )
	g_pcvar_a_standard_cross_spec = register_cvar ( "aim_standard_cross_spec"     ,     "0"                           )
	g_pcvar_a_static_cross_spec   = register_cvar ( "aim_static_cross_spec"       ,     "0"                           )
	g_pcvar_a_snipers_cross_spec  = register_cvar ( "aim_snipers_cross_spec"      ,     "0"                           )
	register_forward                              ( FM_TraceLine , "fwTraceLine"  ,      1                            )
	register_event                                ( "SetFOV"     , "Event_SetFOV" ,     "b"                           )
	register_event                                ( "CurWeapon"  , "Cross_Mode"   ,     "b"     , "1=1"               )

	static szWeaponName [ 32 ] , NOSHOT_BITSUM = ( 1<<CSW_KNIFE ) | ( 1<<CSW_HEGRENADE ) | ( 1<<CSW_FLASHBANG ) | ( 1<<CSW_SMOKEGRENADE )
	for ( new iId = CSW_P228; iId <= CSW_P90; iId++ )
	{
		if ( ~NOSHOT_BITSUM & 1<<iId && get_weaponname ( iId , szWeaponName , charsmax ( szWeaponName ) ) )
			RegisterHam ( Ham_Weapon_PrimaryAttack , szWeaponName , "Recoil_Control" , 1 )
	}
}

public grenade_throw ( id , grenadeIndex , weaponId )
{
	if ( num ( g_pcvar_a_realism ) && weaponId == CSW_FLASHBANG && crxranks_get_user_level(id) == 33 )
	{
		set_task ( 1.5 , "Generic_Flashed" )
		set_task ( 1.7 , "Generic_No_Flashed" )
	}
}

public Generic_Flashed ( )

	FLASHED = true

public Generic_No_Flashed ( )

	FLASHED = false

public fwTraceLine ( const Float: start [ 3 ] , Float: dest [ 3 ] , HITZONE , id , ptr )
{
	if ( !num    ( g_pcvar_a_realism )
	||   !ALIVE  ( id )
	||    HITZONE       != DONT_IGNORE_MONSTERS
    ||    WEAPON ( id ) == CSW_KNIFE 
    || crxranks_get_user_level(id) != 33 )
	return

	static button; button = pev ( id , pev_button )

	if ( button && IN_ATTACK && FLASHED != true )
	{
		if ( !SHOTGUN )
		{
			velocity_by_aim ( id , 9999 , dest )
			xs_vec_add ( start , dest , dest )
		}

		if ( SHOTGUN && get_user_aiming ( id , target , body , 2000 ) && target )
		{
			velocity_by_aim ( id , num ( g_pcvar_a_shotguns_accuracy ) , dest )
			xs_vec_add ( start , dest , dest )
		}

		engfunc ( EngFunc_TraceLine , start , dest , HITZONE , id , ptr )
	}
}

public Recoil_Control ( ent , Float: push [ 3 ] )
{
    new id = pev ( ent , pev_owner )
    if ( num ( g_pcvar_a_realism ) && crxranks_get_user_level(id) == 33 )
    {
        pev ( id , pev_punchangle , push )
        xs_vec_mul_scalar ( push , get_pcvar_float ( g_pcvar_a_recoil ) , push )
        set_pev ( id , pev_punchangle , push )
    }
}

public Event_SetFOV ( id )

	ON_SCOPE [ id ] = ( read_data ( 1 ) < 55 )

public Cross_Mode ( id )
{
	if ( !ON_SCOPE [ id ] && crxranks_get_user_level(id) == 33 )
	{
		new SNIPER = WEAPON ( id ) == CSW_G3SG1
				  || WEAPON ( id ) == CSW_SCOUT
				  || WEAPON ( id ) == CSW_SG550 , CM = 64

		if ( num ( g_pcvar_a_standard_cross      ) &&  ALIVE ( id )
		||   num ( g_pcvar_a_standard_cross_spec ) && !ALIVE ( id ) )
			 CM =  0

		message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "HideWeapon" ) ,_, id ); write_byte ( CM ); message_end

		if ( ALIVE ( id ) && num ( g_pcvar_a_static_cross       ) && !SNIPER
		||   ALIVE ( id ) && num ( g_pcvar_a_cross_snipers      ) &&  SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_static_cross_spec  ) && !SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_snipers_cross_spec ) &&  SNIPER ) {
			 message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "Crosshair" ) , { 0 , 0 , 0 } , id ); write_byte ( 1 ); message_end
		}
	}
}

Basit istek

Gönderilme zamanı: Pzt Eki 25, 2021 9:27 pm
gönderen ERRA
orucoglukayra yazdı: Pzt Eki 25, 2021 9:07 pm Deneyin ;

Kod: Tümünü seç

#include < amxmodx >
#include < fakemeta_util >
#include < hamsandwich >

native crxranks_get_user_level(index);

#define MAX_CLIENTS   32
#define WEAPON        get_user_weapon
#define SHOTGUN     ( WEAPON ( id ) == CSW_M3 || WEAPON ( id ) == CSW_XM1014 )
#define num           get_pcvar_num
#define ALIVE         is_user_alive

new   g_pcvar_a_realism
	, g_pcvar_a_shotguns_accuracy
	, g_pcvar_a_recoil
	, g_pcvar_a_cross_snipers
	, g_pcvar_a_standard_cross
	, g_pcvar_a_static_cross
	, g_pcvar_a_standard_cross_spec
	, g_pcvar_a_static_cross_spec
	, g_pcvar_a_snipers_cross_spec
	, target , body , bool: FLASHED
	, bool: ON_SCOPE [ MAX_CLIENTS + 1 ]

public plugin_init ( )
{
	register_plugin                               ( "Aim Realism"                 , "2.2.5"     , "WATCH_DOGS UNITED" )
	g_pcvar_a_realism             = register_cvar ( "aim__realism"                ,     "1"                           )
	g_pcvar_a_shotguns_accuracy   = register_cvar ( "aim__shotguns_accuracy"      ,  "2020"                           )
	g_pcvar_a_recoil              = register_cvar ( "aim__recoil"                 ,     "0.237"                       )
	g_pcvar_a_standard_cross      = register_cvar ( "aim__standard_crosshair"     ,     "0"                           )
	g_pcvar_a_static_cross        = register_cvar ( "aim__static_crosshair"       ,     "0"                           )
	g_pcvar_a_cross_snipers       = register_cvar ( "aim__snipers_crosshair"      ,     "0"                           )
	g_pcvar_a_standard_cross_spec = register_cvar ( "aim_standard_cross_spec"     ,     "0"                           )
	g_pcvar_a_static_cross_spec   = register_cvar ( "aim_static_cross_spec"       ,     "0"                           )
	g_pcvar_a_snipers_cross_spec  = register_cvar ( "aim_snipers_cross_spec"      ,     "0"                           )
	register_forward                              ( FM_TraceLine , "fwTraceLine"  ,      1                            )
	register_event                                ( "SetFOV"     , "Event_SetFOV" ,     "b"                           )
	register_event                                ( "CurWeapon"  , "Cross_Mode"   ,     "b"     , "1=1"               )

	static szWeaponName [ 32 ] , NOSHOT_BITSUM = ( 1<<CSW_KNIFE ) | ( 1<<CSW_HEGRENADE ) | ( 1<<CSW_FLASHBANG ) | ( 1<<CSW_SMOKEGRENADE )
	for ( new iId = CSW_P228; iId <= CSW_P90; iId++ )
	{
		if ( ~NOSHOT_BITSUM & 1<<iId && get_weaponname ( iId , szWeaponName , charsmax ( szWeaponName ) ) )
			RegisterHam ( Ham_Weapon_PrimaryAttack , szWeaponName , "Recoil_Control" , 1 )
	}
}

public grenade_throw ( id , grenadeIndex , weaponId )
{
	if ( num ( g_pcvar_a_realism ) && weaponId == CSW_FLASHBANG && crxranks_get_user_level(id) == 33 )
	{
		set_task ( 1.5 , "Generic_Flashed" )
		set_task ( 1.7 , "Generic_No_Flashed" )
	}
}

public Generic_Flashed ( )

	FLASHED = true

public Generic_No_Flashed ( )

	FLASHED = false

public fwTraceLine ( const Float: start [ 3 ] , Float: dest [ 3 ] , HITZONE , id , ptr )
{
	if ( !num    ( g_pcvar_a_realism )
	||   !ALIVE  ( id )
	||    HITZONE       != DONT_IGNORE_MONSTERS
    ||    WEAPON ( id ) == CSW_KNIFE 
    || crxranks_get_user_level(id) != 33 )
	return

	static button; button = pev ( id , pev_button )

	if ( button && IN_ATTACK && FLASHED != true )
	{
		if ( !SHOTGUN )
		{
			velocity_by_aim ( id , 9999 , dest )
			xs_vec_add ( start , dest , dest )
		}

		if ( SHOTGUN && get_user_aiming ( id , target , body , 2000 ) && target )
		{
			velocity_by_aim ( id , num ( g_pcvar_a_shotguns_accuracy ) , dest )
			xs_vec_add ( start , dest , dest )
		}

		engfunc ( EngFunc_TraceLine , start , dest , HITZONE , id , ptr )
	}
}

public Recoil_Control ( ent , Float: push [ 3 ] )
{
    new id = pev ( ent , pev_owner )
    if ( num ( g_pcvar_a_realism ) && crxranks_get_user_level(id) == 33 )
    {
        pev ( id , pev_punchangle , push )
        xs_vec_mul_scalar ( push , get_pcvar_float ( g_pcvar_a_recoil ) , push )
        set_pev ( id , pev_punchangle , push )
    }
}

public Event_SetFOV ( id )

	ON_SCOPE [ id ] = ( read_data ( 1 ) < 55 )

public Cross_Mode ( id )
{
	if ( !ON_SCOPE [ id ] && crxranks_get_user_level(id) == 33 )
	{
		new SNIPER = WEAPON ( id ) == CSW_G3SG1
				  || WEAPON ( id ) == CSW_SCOUT
				  || WEAPON ( id ) == CSW_SG550 , CM = 64

		if ( num ( g_pcvar_a_standard_cross      ) &&  ALIVE ( id )
		||   num ( g_pcvar_a_standard_cross_spec ) && !ALIVE ( id ) )
			 CM =  0

		message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "HideWeapon" ) ,_, id ); write_byte ( CM ); message_end

		if ( ALIVE ( id ) && num ( g_pcvar_a_static_cross       ) && !SNIPER
		||   ALIVE ( id ) && num ( g_pcvar_a_cross_snipers      ) &&  SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_static_cross_spec  ) && !SNIPER
		||  !ALIVE ( id ) && num ( g_pcvar_a_snipers_cross_spec ) &&  SNIPER ) {
			 message_begin ( MSG_ONE_UNRELIABLE , get_user_msgid ( "Crosshair" ) , { 0 , 0 , 0 } , id ); write_byte ( 1 ); message_end
		}
	}
}
eline emeğine sağlık sonsuz teşekürler