Raised This Month: $ Target: $400
 0% 

Get cz bots to stop when shooting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-16-2011 , 11:35   Re: Get cz bots to stop when shooting
Reply With Quote #1

#include < fun >
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 12-16-2011 , 11:52   Re: Get cz bots to stop when shooting
Reply With Quote #2

Quote:
Originally Posted by Devil259 View Post
#include < fun >
Forgot about that. Thanks. Edited.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
LukeyB
Member
Join Date: Dec 2011
Old 12-16-2011 , 12:45   Re: Get cz bots to stop when shooting
Reply With Quote #3

I appreciate your help with this. Unfortunately the speed does not reset until weapon is changed, which is a problem for the bots. I would like for this not to affect players, only bots and when I add is_user_alive(id) && is_user_bot(id) && to the script, i get error 017: undefined symbol "id".

PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fun >
const m_pPlayer 41;
public 
plugin_init( )
{
    new 
WeaponName32 ];
    
// no knifes, nades or c4
    
new NoPrimaryAttack = ( ( << CSW_KNIFE ) | ( << CSW_HEGRENADE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) | ( << CSW_C4 ) ); 
    for( new 
CSWConstant CSW_P228CSWConstant <= CSW_P90CSWConstant++ ) 
    {
        if( 
is_user_alive(id) && is_user_bot(id) && ~NoPrimaryAttack & ( << CSWConstant // check for invalid CSW_* constants
        
&& get_weaponnameCSWConstantWeaponNamecharsmaxWeaponName ) ) ) // get weaponname
        
{
            
RegisterHamHam_Weapon_PrimaryAttackWeaponName"Ham_Weapon_PrimaryAttack_Pre"); // hook pre
            
RegisterHamHam_Weapon_PrimaryAttackWeaponName"Ham_Weapon_PrimaryAttack_Post"); // hook post
        
}
    }
}
public 
Ham_Weapon_PrimaryAttack_PreWeapon 
{
    new 
id get_pdata_cbaseWeaponm_pPlayer); 
    
    
set_user_maxspeedid0.1 ); // set low speed
}
public 
Ham_Weapon_PrimaryAttack_PostWeapon 
{
    new 
id get_pdata_cbaseWeaponm_pPlayer); 
    
    
set_user_maxspeedid ); // reset speed

Thanks again for your help!
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