Raised This Month: $ Target: $400
 0% 

Hooking bots hurt


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-01-2009 , 16:46   Re: Hooking bots hurt
Reply With Quote #9

Then, you would have to set 3 values for gBotsRegistered :

0 = not registered
1 = registering soon
2 = registered

Advantage is that you don't use any task + it's immediatly registered.

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.1"

new g_iFhUpdateClientDatag_iFirstBotId

public plugin_init()
{
    
register_plugin("TakeDamage"VERSION"ConnorMcLeod")

    new 
szModName[6]
    
get_modname(szModNamecharsmax(szModName))
    if( !
equal(szModName"czero") || cvar_exists("pb_version") )
    {
        
g_iFhUpdateClientData = -1
    
}

    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage")
}

public 
client_putinserverid )
{
    if( !
g_iFhUpdateClientData && is_user_bot(id) )
    {
        
g_iFirstBotId id
        g_iFhUpdateClientData 
register_forward(FM_UpdateClientData"UpdateClientData")
    }
    
}

public 
UpdateClientData(id)
{
    if( 
id == g_iFirstBotId )
    {
        
unregister_forward(FM_UpdateClientDatag_iFhUpdateClientData)
        
RegisterHamFromEntity(Ham_TakeDamageid"Player_TakeDamage")
    }
}

public 
Player_TakeDamageid iInflictor iAttackerFloat:flDamage iDamageType )
{


__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 10-02-2009 at 13:18.
ConnorMcLeod is offline
 



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