Raised This Month: $32 Target: $400
 8% 

Solved [CS:GO]How to make chicken follow player


Post New Thread Reply   
 
Thread Tools Display Modes
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 07-05-2018 , 11:28   Re: [CS:GO]How to make chicken follow player
Reply With Quote #11

Maybe you can sdkhook takedamage/traceattack something like:
PHP Code:
public void SpawnChicken()
{
    
//...
    
iLife[chickenEnt] = 100;    
    
SDKHook(chickenEntSDKHook_OnTakeDamageHook_TakeDamage);
}


public 
Action Hook_TakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if (
iLife[victim] <= 0//The ent has no life set
        
return Plugin_Continue;
        
    
iLife[victim] -=  damage;
    if (
iLife[victim] > 0)
        return 
Plugin_Stop;

__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 07-05-2018 at 11:28.
Papero is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-05-2018 , 18:36   Re: [CS:GO]How to make chicken follow player
Reply With Quote #12

Quote:
Originally Posted by Papero View Post
Maybe you can sdkhook takedamage/traceattack something like:
PHP Code:
public void SpawnChicken()
{
    
//...
    
iLife[chickenEnt] = 100;    
    
SDKHook(chickenEntSDKHook_OnTakeDamageHook_TakeDamage);
}


public 
Action Hook_TakeDamage(int victimint &attackerint &inflictorfloat &damageint &damagetype)
{
    if (
iLife[victim] <= 0//The ent has no life set
        
return Plugin_Continue;
        
    
iLife[victim] -=  damage;
    if (
iLife[victim] > 0)
        return 
Plugin_Stop;

I think SetEntityHealth would be similar, chickens do have 1 health after all...
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 07-06-2018 , 04:55   Re: [CS:GO]How to make chicken follow player
Reply With Quote #13

Quote:
Originally Posted by eyal282 View Post
I think SetEntityHealth would be similar, chickens do have 1 health after all...
I thought that, that way wouldn't work properly since he's looking for other ways.
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 07-06-2018 , 13:11   Re: [CS:GO]How to make chicken follow player
Reply With Quote #14

Quote:
Originally Posted by Indarello View Post
Sorry, i made mistake with entityindex when i was testing leader before
Somebody know how to make chicken faster?
I tried:
SetEntPropFloat(chicken, Prop_Data, "m_flGroundSpeed", 2.0);
SetEntPropFloat(chicken, Prop_Data, "m_flSpeed", 2.0);
Too bad this don't work
__________________
8guawong 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 18:21.


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