Raised This Month: $ Target: $400
 0% 

Hooking bots hurt


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-30-2009 , 12:10   Re: Hooking bots hurt
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
Ham_TakeDamage works fine with podbot.
But not with CZ bots.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "Registering bots with ham"
#define VERSION "1.0"
#define AUTHOR "SnoW"
new bool:gBotsRegistered;
public 
plugin_init( )
{
     
register_pluginPLUGINVERSIONAUTHOR );
     
/*
          We are registering normal players just as an example.
     */
     
RegisterHamHam_Spawn"player""hamSpawnPlayer");
}
public 
client_authorizedid )
     if( !
gBotsRegistered && is_user_botid ) )
     {
          
/*
               The registering has to be delayed since the bot hasn't any data yet.
          */
          
set_task0.1"register_bots"id );
     }
 
public 
register_botsid )
{
     if( !
gBotsRegistered && is_user_connectedid ) )
     {
          
/*
               If registering wasn't done in the middle of the task and the bot haven't disconnected.
          */
          
RegisterHamFromEntityHam_Spawnid"hamSpawnBot");
          
gBotsRegistered true;
     }
}
public 
hamSpawnBotid )
{
     if( 
is_user_aliveid ) )
          
server_print"Bot spawn hooked correctly." );
     return 
HAM_IGNORED;
}
public 
hamSpawnPlayerid )
{
     if( 
is_user_aliveid ) )
          
server_print"Player spawn hooked correctly." );
     return 
HAM_IGNORED;

Edit: Reason below

Last edited by SnoW; 09-30-2009 at 12:19.
SnoW is offline
Send a message via MSN to SnoW
 


Thread Tools
Display Modes

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 02:02.


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