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

[L4D2] Detect pill passing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-04-2018 , 11:10   [L4D2] Detect pill passing
Reply With Quote #1

I'm trying to catch the pills or adrenaline being passed in the game. I was trying to use SDKCall for this as I was able to find this function in the library. Can't seem to get the parameters right on this. Can anyone help me?

PHP Code:
.text:008DA810
.text:008DA810 ; =============== S U B R O U T I N E =======================================
.
text:008DA810
.text:008DA810 Attributesbp-based frame
.text:008DA810
.text:008DA810 int __cdecl SurvivorGivePillsToFriend::SurvivorGivePillsToFriend(SurvivorUseObject *, CBaseEntity *)
.
text:008DA810 _ZN25SurvivorGivePillsToFriendC2EP13CTerrorPlayer proc near
.text:008DA810                                         CODE XREFSurvivorBot::UseHealingItems(Action<SurvivorBot> *)+518p
.text:008DA810                                         SurvivorBot::UseHealingItems(Action<SurvivorBot> *)+6D1p
.text:008DA810
.text:008DA810 arg_0           dword ptr  8
.text:008DA810 arg_4           dword ptr  0Ch
.text:008DA810
.text:008DA810                 push    ebp
.text:008DA811                 mov     ebpesp
.text:008DA813                 push    ebx
.text:008DA814                 sub     esp14h
.text:008DA817                 mov     ebx, [ebp+arg_0]
.
text:008DA81A                 mov     eax, [ebp+arg_4]
.
text:008DA81D                 mov     [esp], ebx      this
.text:008DA820                 mov     [esp+4], eax    CBaseEntity *
.
text:008DA824                 call    _ZN17SurvivorUseObjectC2EP11CBaseEntity SurvivorUseObject::SurvivorUseObject(CBaseEntity *)
.
text:008DA829                 mov     dword ptr [ebx], offset off_C9D4E8
.text:008DA82F                 mov     dword ptr [ebx+4], offset off_C9D664
.text:008DA836                 add     esp14h
.text:008DA839                 pop     ebx
.text:008DA83A                 pop     ebp
.text:008DA83B                 retn
.text:008DA83B _ZN25SurvivorGivePillsToFriendC2EP13CTerrorPlayer endp
.text:008DA83B
.text:008DA83B ; --------------------------------------------------------------------------- 
__________________
Spirit_12 is offline
oceanyss
Member
Join Date: Jan 2012
Old 05-04-2018 , 11:18   Re: [L4D2] Detect pill passing
Reply With Quote #2

Why not use the award_earned Event? It does exactly what you want.
oceanyss is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-04-2018 , 11:28   Re: [L4D2] Detect pill passing
Reply With Quote #3

Quote:
Originally Posted by oceanyss View Post
Why not use the award_earned Event? It does exactly what you want.
I never looked into that event, but yeah you are right. It seems to be exactly what I want.

Thanks a lot.
__________________
Spirit_12 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-04-2018 , 15:12   Re: [L4D2] Detect pill passing
Reply With Quote #4

Quote:
Originally Posted by Spirit_12 View Post
I never looked into that event, but yeah you are right. It seems to be exactly what I want.

Thanks a lot.
For future reference if u look at my oshroths backpack plugin theres an event in there that can detect pills passing using the bit number for pills or adrenaline, i used it to fix a bug with the plugin.
MasterMind420 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-04-2018 , 19:41   Re: [L4D2] Detect pill passing
Reply With Quote #5

Quote:
Originally Posted by MasterMind420 View Post
For future reference if u look at my oshroths backpack plugin theres an event in there that can detect pills passing using the bit number for pills or adrenaline, i used it to fix a bug with the plugin.
Actually your Backpack plugin is exactly what I was trying to fix. I don't see any event that detects the pills or adrenaline pass. Maybe I just skipped over it. Can you get me the name of the event?
__________________
Spirit_12 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-04-2018 , 20:06   Re: [L4D2] Detect pill passing
Reply With Quote #6

Quote:
Originally Posted by Spirit_12 View Post
Actually your Backpack plugin is exactly what I was trying to fix. I don't see any event that detects the pills or adrenaline pass. Maybe I just skipped over it. Can you get me the name of the event?
Lol nice...yah actually its quite possible i never released the update. I'll get back to u as soon as i can, but i know i fixed it.
MasterMind420 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-04-2018 , 20:12   Re: [L4D2] Detect pill passing
Reply With Quote #7

also on a side note i have completed version 1.0 which is almost a complete rewrite, the pills passing bug doesn't exist anymore because i'm doing it completely different now. Also you can toggle thru all backpack items just pressing your number keys repeatedly and there's some new stuff as well. I've been hesitant to release it though(minor bugs i haven't had time to bother with).
MasterMind420 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-04-2018 , 20:49   Re: [L4D2] Detect pill passing
Reply With Quote #8

Quote:
Originally Posted by MasterMind420 View Post
also on a side note i have completed version 1.0 which is almost a complete rewrite, the pills passing bug doesn't exist anymore because i'm doing it completely different now. Also you can toggle thru all backpack items just pressing your number keys repeatedly and there's some new stuff as well. I've been hesitant to release it though(minor bugs i haven't had time to bother with).
I won't mind doing some testing, if you willing to hand me the code before the release.
__________________
Spirit_12 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 05-04-2018 , 21:45   Re: [L4D2] Detect pill passing
Reply With Quote #9

Code:
HookEvent("weapon_given", eGiveWeapon, EventHookMode_Pre);

//PILLS PASS QUANTITY FIX
public void eGiveWeapon(Handle event, const char[] name, bool dontBroadcast)
{
	int receiver = GetClientOfUserId(GetEventInt(event, "userid"));

	char item[32];
	GetEventString(event, "weapon", item, sizeof(item));

	if(StrEqual(item, "23")) //ADRENALINE ID
		Adrenaline[receiver] += 1;
	else if(StrEqual(item, "15")) //PILLS ID
		PainPills[receiver] += 1;
}
//PILLS PASS QUANTITY FIX
This is the code i used to detect passing pills, are you correcting the quantity or are you actually correcting the pills passing problem? I don't know if the released version actually corrects it or not. The version I got this from does. If its the latter i'll look over the code and share what I did to fix it.

Also I will consider sharing the code from my new backpack plugin for testing purposes but i make no promises. I need to talk to someone else involved because some of the code i used in it was given to me.
MasterMind420 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-04-2018 , 22:38   Re: [L4D2] Detect pill passing
Reply With Quote #10

I was trying to fix the passing problem. Pills and Adrenaline tend to dispensary upon the pass, while the target never receives them.
__________________
Spirit_12 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 14:23.


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