Raised This Month: $ Target: $400
 0% 

[TF2] Block dispenser to give ammo


Post New Thread Reply   
 
Thread Tools Display Modes
barel31
Member
Join Date: Mar 2011
Old 06-14-2014 , 16:48   Re: [TF2] Block dispenser to give ammo
Reply With Quote #11

Quote:
Originally Posted by WildCard65 View Post
Try:
Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2attributes>

public OnPluginStart()
{
	HookEvent("player_spawn", Event_PlayerSpawn);
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(IsPlayerAlive(client) && GetClientTeam(client) == RED)
	{
		TF2Attrib_SetByDefIndex(client, 421, 1.0);
	}
}
Edit: You were using attri #345 which Engi Dispenser Radius Increase.
Don't work..
barel31 is offline
barel31
Member
Join Date: Mar 2011
Old 06-15-2014 , 09:08   Re: [TF2] Block dispenser to give ammo
Reply With Quote #12

Up
barel31 is offline
barel31
Member
Join Date: Mar 2011
Old 06-15-2014 , 15:35   Re: [TF2] Block dispenser to give ammo
Reply With Quote #13

Up
barel31 is offline
barel31
Member
Join Date: Mar 2011
Old 06-16-2014 , 07:36   Re: [TF2] Block dispenser to give ammo
Reply With Quote #14

Up
barel31 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-16-2014 , 11:32   Re: [TF2] Block dispenser to give ammo
Reply With Quote #15

Wait 14 days before bumping, also it would help if you at least told me how it doesn't work.
Edit: nvm I think I see why.
Edit2: Try:
Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2attributes>

public OnPluginStart()
{
	HookEvent("player_spawn", Event_PlayerSpawn);
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(GetClientTeam(client) == RED)
	{
		TF2Attrib_SetByDefIndex(client, 421, 1.0);
	}
}

Last edited by WildCard65; 06-16-2014 at 11:33.
WildCard65 is offline
barel31
Member
Join Date: Mar 2011
Old 06-16-2014 , 23:51   Re: [TF2] Block dispenser to give ammo
Reply With Quote #16

Quote:
Originally Posted by WildCard65 View Post
Wait 14 days before bumping, also it would help if you at least told me how it doesn't work.
Edit: nvm I think I see why.
Edit2: Try:
Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2attributes>

public OnPluginStart()
{
	HookEvent("player_spawn", Event_PlayerSpawn);
}

public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	
	if(GetClientTeam(client) == RED)
	{
		TF2Attrib_SetByDefIndex(client, 421, 1.0);
	}
}
Its just don't work.
The dispenser keep give me ammo.
I even try to give the attribute by command and this don't work too.

Last edited by barel31; 06-16-2014 at 23:51.
barel31 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-17-2014 , 11:26   Re: [TF2] Block dispenser to give ammo
Reply With Quote #17

Edit: NVM, the attribute is for blocking ammo while active :/

Last edited by WildCard65; 06-17-2014 at 11:27.
WildCard65 is offline
barel31
Member
Join Date: Mar 2011
Old 06-17-2014 , 13:02   Re: [TF2] Block dispenser to give ammo
Reply With Quote #18

Quote:
Originally Posted by WildCard65 View Post
Edit: NVM, the attribute is for blocking ammo while active :/
Oh, any other ways?
barel31 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 06-17-2014 , 16:40   Re: [TF2] Block dispenser to give ammo
Reply With Quote #19

None that I can think of
WildCard65 is offline
El Diablo War3Evo
Veteran Member
Join Date: Jun 2013
Old 06-23-2014 , 05:19   Re: [TF2] Block dispenser to give ammo
Reply With Quote #20

Why not just create the dispenser prop and then create the effects of healing beam on a nearby player? Maybe allow the engineer to "setup" this prop, as a extra dispenser... You could also require there be no other dispensers near by, or no sentries near by this prop before its created. Also possible to destroy the prop if another dispenser or sentry is dropped in that location.

Another idea, although pretty iffy, is to monitor when a player gets ammo from the dispenser, and then removes it from them as soon as they get it. You'd have to monitor the distance of the dispenser via the player and then monitor when the player receives ammo, then remove the extra ammo as soon as the player receives it.

^ just a few ideas. I would offer my services for this one, but since its really iffy, I can't promise any results.
__________________
El Diablo War3Evo 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 04:49.


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