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

[TF2] Dropped Ammo touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-28-2016 , 11:01   [TF2] Dropped Ammo touch
Reply With Quote #1

PHP Code:
public OnPluginStart()
{
    
HookEntityOutput("tf_ammo_pack""OnCacheInteraction"EntityOutput_DroppedAmmo);
}

public 
EntityOutput_DroppedAmmo(const String:output[], calleractivatorFloat:delay)
{
*
My code*

Hi, please help with this. This code should detect dropped ammo touch, but it doesn't do anything.

Last edited by Nursik; 07-28-2016 at 11:06.
Nursik is offline
w1200441
Senior Member
Join Date: Dec 2011
Old 07-29-2016 , 11:06   Re: [TF2] Dropped Ammo touch
Reply With Quote #2

you should try
Code:
public OnEntityCreated(entity, const String:classname[])
{
	SDKHook(entity, SDKHook_Spawn, OnEntitySpawn);
}

public OnEntitySpawn(entity, client)
{
	if(IsValidEntity(entity))
	{
		new String:classname[256];
		GetEntityClassname(entity, classname, sizeof(classname));
		if(StrEqual(classname, "tf_ammo_pack"))
		{
			*your code*
		}
	}
}

Last edited by w1200441; 07-29-2016 at 11:07.
w1200441 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-29-2016 , 20:01   Re: [TF2] Dropped Ammo touch
Reply With Quote #3

It'd help if we knew exactly what you wanted to do with it.

Do you want to block them from picking it up? Do you want to increase how much ammo they get from it? Do you want to make it look like a bonus duck?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Nursik
Senior Member
Join Date: Jul 2016
Location: In TF2
Old 07-30-2016 , 06:18   Re: [TF2] Dropped Ammo touch
Reply With Quote #4

Hey guys, i already found the solution, but thanks (i'll post it when i get home). Now i hope you'll help me not apply overheal with SetClientHealth (+health), it's a stock i found in some plugin and it changes your health with additive number. I'd also like if you could help me add an effect of adding health over the health bar "+health" (like concheror regen, heal restore on kill on powerjack, claymore, etc)?
Nursik 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 00:40.


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