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 , 12:51   Re: Get cz bots to stop when shooting
Reply With Quote #1

You can't use id in plugin_init( )
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 );         if( is_user_bot( id ) )         set_user_maxspeed( id, 0.1 ); // set low speed } public Ham_Weapon_PrimaryAttack_Post( Weapon ) {     new id = get_pdata_cbase( Weapon, m_pPlayer, 4 );         if( is_user_bot( id ) )         set_user_maxspeed( id ); // reset speed }

If it doesn't work, try to use pev_velocity.
__________________
You can do anything you set your mind to, man.


Last edited by Devil259; 12-16-2011 at 12:54.
Devil259 is offline
LukeyB
Member
Join Date: Dec 2011
Old 12-16-2011 , 13:18   Re: Get cz bots to stop when shooting
Reply With Quote #2

Gotcha. I am learning slowly, but surely.

This does stop the bot when shooting, but the bot speed in not reset after shooting so they get stuck in place.

Was reading about pev_velocity and am confused on how to add this instead of set_user_maxspeed.

Thanks again for all of 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