Raised This Month: $12 Target: $400
 3% 

Hooking bots hurt


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-01-2009 , 17:03   Re: Hooking bots hurt
Reply With Quote #11

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
public plugin_putinserverid 
Omg, where'd you get that function?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2009 , 01:08   Re: Hooking bots hurt
Reply With Quote #12

New forward i've found while searching offsets in my kitchen garden.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-02-2009 , 03:30   Re: Hooking bots hurt
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
New forward i've found while searching offsets in my kitchen garden.
LMFAO


so then something like this would work using your methond of hooking bots


PHP Code:
/*
* Thanks to Conor for hooking bots
* to allow for Ham_TakeDamage to work on them
*  
*/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "1.0"

//Conors news
new g_iFhUpdateClientDatag_iFirstBotId;

//My news
new dmg_reduce

public plugin_init()
{
    
register_plugin("Variable Friendly Fire"VERSION"=(GrG)=");
    
    
dmg_reduce register_cvar("dmg_var""0.0");
    
    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);
        
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage");
    }
}

public 
Player_TakeDamageid iInflictor iAttackerFloat:fDamage iDamageType )
{
    
    if(
is_user_alive(id) && is_user_alive(iAttacker) && cs_get_user_team(id) == cs_get_user_team(iAttacker))
    {
        
SetHamParamFloat(4fDamage get_pcvar_float(dmg_reduce));
    }

This would multiply all friendly fire by the mulitplier right?

Last edited by Doc-Holiday; 10-02-2009 at 04:02.
Doc-Holiday is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2009 , 06:24   Re: Hooking bots hurt
Reply With Quote #14

It should be RegisterHamFromEntity()
__________________
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2009 , 13:16   Re: Hooking bots hurt
Reply With Quote #15

Ops
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-02-2009 , 18:04   Re: Hooking bots hurt
Reply With Quote #16

Quote:
Originally Posted by Arkshine View Post
It should be RegisterHamFromEntity()
whats that?
Doc-Holiday is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 10-05-2009 , 14:17   Re: Hooking bots hurt
Reply With Quote #17

By the way it still didnt work
Doc-Holiday is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 10-05-2009 , 19:54   Re: Hooking bots hurt
Reply With Quote #18

Quote:
Originally Posted by NcB_Sav View Post
By the way it still didnt work
Did you fix your code in the UpdateClientData function for RegisterHamFromEntity instead of RegisterHam like was discussed above? Connor did fix his example, you may not have noticed.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-06-2009 , 14:39   Re: Hooking bots hurt
Reply With Quote #19

And if still doesn't work, replace :

g_iFhUpdateClientData = register_forward(FM_UpdateClientData, "UpdateClientData")

with

g_iFhUpdateClientData = register_forward(FM_UpdateClientData, "UpdateClientData", 1)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
WATCH_D0GS UNITED
Senior Member
Join Date: Jan 2023
Old 02-27-2024 , 18:01   Re: Hooking bots hurt
Reply With Quote #20

Quote:
Originally Posted by ConnorMcLeod View Post
And if still doesn't work, replace :

g_iFhUpdateClientData = register_forward(FM_UpdateClientData, "UpdateClientData")

with

g_iFhUpdateClientData = register_forward(FM_UpdateClientData, "UpdateClientData", 1)
Not and will not, because you are trying to register ham for bots in a forward which is not called for bots, lol.
__________________
💻Know Our New Blog👄
🔗tube2downs.blogspot.com
WATCH_D0GS UNITED is offline
Reply


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


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