Raised This Month: $ Target: $400
 0% 

all weapons Ham Deploy


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
by4udilo
Junior Member
Join Date: Dec 2015
Old 12-19-2015 , 06:05   all weapons Ham Deploy
Reply With Quote #1

I want change "weapon_knife" to all weapons in cs 1.6 or use another way...(?),How i can do it?



PHP Code:
public plugin_init( )
{
    
register_plugin    "test" "test" "test" )
//    register_event("CurWeapon","Cur_Weapon","be","1=1" ); no want use it
//      and this FwdPlayerPreThink...
    
RegisterHam(Ham_Item_Deploy,  , "Ham_Item_Deploy_Post"1);
}
public 
Ham_Item_Deploy_Post(weapon_ent){
    new 
id get_pdata_cbase(weapon_ent41)
    
// my code...

by4udilo is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 12-19-2015 , 08:39   Re: all weapons Ham Deploy
Reply With Quote #2

Code:
#include <amxmodx> #include <hamsandwich> new const g_szWeaponList[][] = {     "weapon_usp",     "weapon_glock18",     "weapon_deagle",     "weapon_p228",     "weapon_elite",     "weapon_fiveseven",     "weapon_m3",     "weapon_xm1014",     "weapon_mp5navy",     "weapon_tmp",     "weapon_p90",     "weapon_mac10",     "weapon_ump45",     "weapon_famas",     "weapon_sg552",     "weapon_ak47",     "weapon_m4a1",     "weapon_aug",     "weapon_scout",     "weapon_awp",     "weapon_g3sg1",     "weapon_sg550",     "weapon_galil",     "weapon_m249",     "weapon_hegrenade",     "weapon_smokegrenade",     "weapon_flashbang",     "weapon_c4",     "weapon_shield" }; // Extra offsets #define linux_weapons_diff  4 #define mac_weapons_diff    linux_weapons_diff // not sure if mac is using the same // CBasePlayerItem #define m_pPlayer           41 #define HOOK_COUNT 1 * (sizeof g_szWeaponList) new HamHook:hamhooks[HOOK_COUNT]; public plugin_precache() {     new count = 0;     for( new i; i < sizeof g_szWeaponList; i++ )     {         hamhooks[count++] = RegisterHam( Ham_Item_Deploy, g_szWeaponList[i], "Ham_Item_Deploy_Post", true );     } } public plugin_init() {     for( new i; i < sizeof hamhooks; i++ )     {         EnableHamForward( hamhooks[i] );     } } public plugin_pause() {     for ( new i; i < sizeof hamhooks; i++ )     {         DisableHamForward( hamhooks[i] );     } } public plugin_unpause() {     for ( new i; i < sizeof hamhooks; i++ )     {         EnableHamForward( hamhooks[i] );     } } public Ham_Item_Deploy_Post( iItem ) {     new iPlayer;     iPlayer = get_pdata_cbase(iItem, m_pPlayer, linux_weapons_diff, mac_weapons_diff);     // do stuff }

Last edited by Rirre; 12-19-2015 at 08:48.
Rirre is offline
by4udilo
Junior Member
Join Date: Dec 2015
Old 12-19-2015 , 09:11   Re: all weapons Ham Deploy
Reply With Quote #3

very nice!Very thx!
by4udilo is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-19-2015 , 12:34   Re: all weapons Ham Deploy
Reply With Quote #4

@by4udilo: What exactly are you trying to do? You may not even need to use ItemDeploy.

@Rirre: Is there a reason you are enabling the forwards at plugin_init()? They are enabled upon creation at plugin_precache().

This is pointless and doesn't improve functionality/readability, IMO. Plus, you do not use HOOK_COUNT anywhere else. Why are you multiplying by 1? If you do insist on using a variable to store the number of weapons/hooks, at least use it everywhere that this value is used (in all for loops).
PHP Code:
#define HOOK_COUNT 1 * (sizeof g_szWeaponList)
new HamHook:hamhooks[HOOK_COUNT];

//Just do 
new HamHook:hamhookssizeofg_szWeaponList ) ]; 
What is the purpose of this count variable, why not use i to index hamhooks?
PHP Code:
public plugin_precache()
{
    new 
count 0;

    for( new 
isizeof g_szWeaponListi++ )
    {
        
hamhooks[count++] = RegisterHamHam_Item_Deployg_szWeaponList[i], "Ham_Item_Deploy_Post"true );
    }

__________________

Last edited by Bugsy; 12-19-2015 at 13:13.
Bugsy is offline
by4udilo
Junior Member
Join Date: Dec 2015
Old 12-19-2015 , 14:08   Re: all weapons Ham Deploy
Reply With Quote #5

i want delete draw animation in all weapons.
by4udilo is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-19-2015 , 14:40   Re: all weapons Ham Deploy
Reply With Quote #6

Like this?

https://forums.alliedmods.net/showpo...0&postcount=13
__________________
Bugsy is offline
Old 12-19-2015, 16:35
by4udilo
This message has been deleted by by4udilo. Reason: mo code =D
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-19-2015 , 18:24   Re: all weapons Ham Deploy
Reply With Quote #8

I guess I don't understand exactly what you are trying to block. Instead of describing it as 'draw' animation, can you tell me visually what animation you want blocked?
__________________

Last edited by Bugsy; 12-19-2015 at 18:25.
Bugsy is offline
Old 12-20-2015, 02:35
by4udilo
This message has been deleted by by4udilo. Reason: mo code =D
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-20-2015 , 10:25   Re: all weapons Ham Deploy
Reply With Quote #10

This code does what is in video 1. What else do you need done besides this?
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "HLTV bug"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_UpdateClientData"UpdateClientData"1)
}

public 
UpdateClientData(idsendweaponscd)
{
    if( 
sendweapons )
    {
        if( 
get_cd(cdCD_WeaponAnim) )
        {
            
set_cd(cdCD_WeaponAnim0)
        }
    }

__________________
Bugsy is offline
Reply



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 18:00.


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