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

[L4D2]The reloading time of infected


Post New Thread Reply   
 
Thread Tools Display Modes
Machine
Senior Member
Join Date: Apr 2010
Old 06-27-2012 , 03:17   Re: [L4D2]The reloading time of infected
Reply With Quote #11

It works for me, check out my supertanks plugin for l4d2 for how it works.

If it still doesn't work, then perhaps I'm using a newer sourcemod snapshot than you. Try the newest 1.5 dev snapshot.
Machine is offline
Tony Leung
Member
Join Date: May 2012
Old 06-27-2012 , 03:26   Re: [L4D2]The reloading time of infected
Reply With Quote #12

O thank you my snapshot is 1.4. then i try it now
Tony Leung is offline
Tony Leung
Member
Join Date: May 2012
Old 06-27-2012 , 08:58   Re: [L4D2]The reloading time of infected
Reply With Quote #13

it works now.
however, how to change the reloading time of left click attack of tank
Tony Leung is offline
Machine
Senior Member
Join Date: Apr 2010
Old 06-27-2012 , 11:46   Re: [L4D2]The reloading time of infected
Reply With Quote #14

You could block the attack in playerruncmd and set a timer to allow to attack again.

I haven't done this, but that's probably where I would start.
Machine is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-27-2012 , 15:52   Re: [L4D2]The reloading time of infected
Reply With Quote #15

Or just set the m_flNextSecondaryAttack or m_flNextPrimaryAttack netprop on the players weapon to prevent them from using, or set to GetGameTime() to allow them to use now.
__________________
Silvers is offline
Tony Leung
Member
Join Date: May 2012
Old 06-28-2012 , 06:08   Re: [L4D2]The reloading time of infected
Reply With Quote #16

Can you give me an example because i try it but it doesn't work.i think there maybe somethings wrong.
Tony Leung is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 06-28-2012 , 06:57   Re: [L4D2]The reloading time of infected
Reply With Quote #17

Show what you have tried.
__________________
Silvers is offline
Tony Leung
Member
Join Date: May 2012
Old 06-28-2012 , 07:01   Re: [L4D2]The reloading time of infected
Reply With Quote #18

public OnPluginStart()
{
g_iClassO = FindSendPropInfo("CTerrorPlayer","m_zombieCla ss");
}
public OnGameFrame()
{
Adrenal_OnGameFrame();
}
Adrenal_OnGameFrame()
{
decl iCid;

for (new i=1; i<=GetMaxClients(); i++)
{
if (GetEntData(i, g_iClassO) ==
{
decl ability;
decl Float:time;
ability= GetEntPropEnt(i, Prop_Send, "m_hActiveWeapon");
if (ability > 0)
{
time = GetEntPropFloat(ability, Prop_Send, "m_flNextPrimaryAttack");
}

if (time >1.5 * 0.5)
{
ResetInfectedAbility(iCid, 1.5 * 0.5);
}
}
}

return 0;
}
stock ResetInfectedAbility(client, Float:time)
{
if (client > 0)
{
if (IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
new ability = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if (ability > 0)
{
SetEntPropFloat(ability, Prop_Send, "m_flNextPrimaryAttack", time);
}
}
}
}
Tony Leung is offline
Tony Leung
Member
Join Date: May 2012
Old 06-28-2012 , 07:02   Re: [L4D2]The reloading time of infected
Reply With Quote #19

Quote:
public OnPluginStart()
{
g_iClassO = FindSendPropInfo("CTerrorPlayer","m_zombieCla ss");
}
public OnGameFrame()
{
Adrenal_OnGameFrame();
}
Adrenal_OnGameFrame()
{
decl iCid;

for (new i=1; i<=GetMaxClients(); i++)
{
if (GetEntData(i, g_iClassO) ==
{
decl ability;
decl Float:time;
ability= GetEntPropEnt(i, Prop_Send, "m_hActiveWeapon");
if (ability > 0)
{
time = GetEntPropFloat(ability, Prop_Send, "m_flNextPrimaryAttack");
}

if (time >1.5 * 0.5)
{
ResetInfectedAbility(iCid, 1.5 * 0.5);
}
}
}

return 0;
}
stock ResetInfectedAbility(client, Float:time)
{
if (client > 0)
{
if (IsClientInGame(client) && IsPlayerAlive(client) && GetClientTeam(client) == 3)
{
new ability = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if (ability > 0)
{
SetEntPropFloat(ability, Prop_Send, "m_flNextPrimaryAttack", time);
}
}
}
}
Tony Leung is offline
Tony Leung
Member
Join Date: May 2012
Old 07-04-2012 , 06:51   Re: [L4D2]The reloading time of infected
Reply With Quote #20

silvers the above is my trying
Tony Leung 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 09:58.


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