Raised This Month: $ Target: $400
 0% 

Get cz bots to stop when shooting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LukeyB
Member
Join Date: Dec 2011
Old 12-15-2011 , 16:35   Re: Get cz bots to stop when shooting
Reply With Quote #1

Thanks. How would I go about doing this for all weapons?
LukeyB is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 12-15-2011 , 17:40   Re: Get cz bots to stop when shooting
Reply With Quote #2

Code:
#include < amxmodx > #include < hamsandwich > #include < fun > const m_pPlayer = 41; public plugin_init( ) {     new WeaponName[ 32 ];     // no knifes, nades or c4     new NoPrimaryAttack = ( ( 1 << CSW_KNIFE ) | ( 1 << CSW_HEGRENADE ) | ( 1 << CSW_FLASHBANG ) | ( 1 << CSW_SMOKEGRENADE ) | ( 1 << CSW_C4 ) );     for( new CSWConstant = CSW_P228; CSWConstant <= CSW_P90; CSWConstant++ )     {         if( ~NoPrimaryAttack & ( 1 << CSWConstant ) // check for invalid CSW_* constants         && get_weaponname( CSWConstant, WeaponName, charsmax( WeaponName ) ) ) // get weaponname         {             RegisterHam( Ham_Weapon_PrimaryAttack, WeaponName, "Ham_Weapon_PrimaryAttack_Pre", 0 ); // hook pre             RegisterHam( Ham_Weapon_PrimaryAttack, WeaponName, "Ham_Weapon_PrimaryAttack_Post", 1 ); // hook post         }     } } public Ham_Weapon_PrimaryAttack_Pre( Weapon ) {     new id = get_pdata_cbase( Weapon, m_pPlayer, 4 );         set_user_maxspeed( id, 0.1 ); // set low speed } public Ham_Weapon_PrimaryAttack_Post( Weapon ) {     new id = get_pdata_cbase( Weapon, m_pPlayer, 4 );         set_user_maxspeed( id ); // reset speed }
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 12-16-2011 at 11:53.
Xellath is offline
LukeyB
Member
Join Date: Dec 2011
Old 12-16-2011 , 10:14   Re: Get cz bots to stop when shooting
Reply With Quote #3

Thanks for your help, but I get a lot of errors when trying to compile this.

Last edited by LukeyB; 12-16-2011 at 10:15.
LukeyB 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 12:04.


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