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

[TF2] Rate of Fire


Post New Thread Reply   
 
Thread Tools Display Modes
Sreaper
髪を用心
Join Date: Nov 2009
Old 01-08-2015 , 01:15   Re: [TF2] Rate of Fire
Reply With Quote #121

Quote:
Originally Posted by lil Gr:m View Post
sorry, sorta new, how to i make this into a smx? or where do i put this?
addons/sourcemod/scripting/thattextthere.sp

Click compile.sh, it will be under /compiled/

Last edited by Sreaper; 01-08-2015 at 01:23.
Sreaper is offline
lil Gr:m
Junior Member
Join Date: Dec 2004
Old 01-12-2015 , 01:26   Re: [TF2] Rate of Fire
Reply With Quote #122

still did not work
lil Gr:m is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 01-12-2015 , 13:59   Re: [TF2] Rate of Fire
Reply With Quote #123

Quote:
Originally Posted by lil Gr:m View Post
still did not work
Why do you lie ? I hate this
Look what I just did for you.
__________________
Want to check my plugins ?
Arkarr is offline
simon_fears
New Member
Join Date: Feb 2015
Old 02-04-2015 , 05:44   Re: [TF2] Rate of Fire
Reply With Quote #124

hey,im new to fourms,and i just want to ask,(im also new to hosting a server) how to give the ROF to people who join the server even though im not in the server,so it gives it automaticly when they join,
simon_fears is offline
DarkEvil
AlliedModders Donor
Join Date: May 2013
Location: 127.0.0.1@root
Old 02-04-2015 , 10:54   Re: [TF2] Rate of Fire
Reply With Quote #125

Is it possible to be the max of it 2?
!rof 2
DarkEvil is offline
Snaggle
AlliedModders Donor
Join Date: Jul 2010
Location: England
Old 02-04-2015 , 12:51   Re: [TF2] Rate of Fire
Reply With Quote #126

Quote:
Originally Posted by DarkEvil View Post
Is it possible to be the max of it 2?
!rof 2
You could probably change this part.

PHP Code:
if (amount || amount 10)
    {
        
ReplyToCommand(client"[SM] Invalid Amount");
        return 
Plugin_Handled;
    } 
Replace 10 with 2 to make it the max amount. Can edit the "Invalid Amount" message as well.
Snaggle is offline
msoza1
Junior Member
Join Date: Mar 2015
Location: California
Old 04-01-2015 , 23:39   Re: [TF2] Rate of Fire
Reply With Quote #127

Do you think you can change the rate of fire on Sentries?
__________________
*Insert Generic Knockoff Signature Here*
msoza1 is offline
Send a message via Skype™ to msoza1
i like money
New Member
Join Date: Apr 2015
Old 04-04-2015 , 16:43   Re: [TF2] Rate of Fire
Reply With Quote #128

when i put in the command i get invalid amount
can someone give a example on how to use it
i like money is offline
enstage
AlliedModders Donor
Join Date: Oct 2014
Location: Australia
Old 05-10-2015 , 04:31   Re: [TF2] Rate of Fire
Reply With Quote #129

Hey, I run quite a large group of rapid fire servers, recently we moved hosts and blah blah blah...

But anyway the new host pointed out that my servers are absolutely chewing the CPU. I'm quite sure its the method that I use to give everyone ROF that is what is causing it.

Can anyone make/is there a way I can make a modification to the plugin so that everyone has it automatically upon joining?

If you could that would be FANTASTIC.
__________________

~Enstage
enstage is offline
Send a message via Skype™ to enstage
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-10-2015 , 05:30   Re: [TF2] Rate of Fire
Reply With Quote #130

Quote:
Originally Posted by enstage View Post
Hey, I run quite a large group of rapid fire servers, recently we moved hosts and blah blah blah...

But anyway the new host pointed out that my servers are absolutely chewing the CPU. I'm quite sure its the method that I use to give everyone ROF that is what is causing it.

Can anyone make/is there a way I can make a modification to the plugin so that everyone has it automatically upon joining?

If you could that would be FANTASTIC.
Take a look at line 43, you can edit the 8.0 to 10.0 if you prefer a default fire speed of 10.0.
Not tested.
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "1.2"

new OffAW = -1;
new 
Float:LastCharge[MAXPLAYERS+1];
new 
Float:Multi[MAXPLAYERS+1];
new 
bool:SpeedEnabled[MAXPLAYERS+1];
new 
bool:InAttack[MAXPLAYERS+1];
new 
Handle:g_hcvarSniperScope INVALID_HANDLE;
new 
Handle:g_hcvarHuntsman INVALID_HANDLE;


public 
Plugin:myinfo 
{
    
name "[TF2] Rate of Fire",
    
author "EHG",
    
description "Modify weapon rate of fire",
    
version PLUGIN_VERSION,
    
url ""
}


public 
OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
OffAW FindSendPropInfo("CBasePlayer""m_hActiveWeapon");
    
    
CreateConVar("sm_tf2_rof_version"PLUGIN_VERSION"TF2 Rate of Fire version"FCVAR_PLUGIN|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
g_hcvarSniperScope CreateConVar("sm_tf2_rof_scope""0""Set if rof should effect sniper scope"0true0.0true1.0);
    
g_hcvarHuntsman CreateConVar("sm_tf2_rof_huntsman""1""Set if rof should effect huntsman"0true0.0true1.0);
    
    
RegAdminCmd("sm_rof"Command_Rof0"Set Rate of Fire");
    
    for (new 
0<= MaxClientsi++) OnClientPostAdminCheck(i);
}


public 
OnClientPostAdminCheck(client)
{
    
Multi[client] = 8.0;     //Edit this (min 1.0 -> max 10.0)
    
SpeedEnabled[client] = true;
    
InAttack[client] = false;
    
LastCharge[client] = 0.0;
}


public 
Action:Command_Rof(clientargs)
{
    
decl String:arg[65];
    
decl String:arg2[20];
    new 
Float:amount;
    new 
bool:HasTarget false;
    
    if (
CheckCommandAccess(client"sm_rof_access_target"ADMFLAG_ROOT))
    {
        if (
args 2)
        {
            
ReplyToCommand(client"[SM] Usage: sm_rof <#userid|name> <1.0 - 10.0>");
            return 
Plugin_Handled;
        }
        
        
GetCmdArg(1argsizeof(arg));
        
GetCmdArg(2arg2sizeof(arg2));
        
        
amount StringToFloat(arg2);
        
        
HasTarget true;
    }
    else if (
CheckCommandAccess(client"sm_rof_access"ADMFLAG_GENERIC))
    {
        if (
args != 1)
        {
            
ReplyToCommand(client"[SM] Usage: sm_rof <1.0 - 10.0>");
            return 
Plugin_Handled;
        }
        
        
GetCmdArg(1argsizeof(arg));
        
amount StringToFloat(arg);
    }
    else
    {
        
ReplyToCommand(client"[SM] You do not have access to this command.");
        return 
Plugin_Handled;
    }
    
    
    if (
amount || amount 10)
    {
        
ReplyToCommand(client"[SM] Invalid Amount");
        return 
Plugin_Handled;
    }
    
    
    
decl String:target_name[MAX_TARGET_LENGTH];
    
    if (
HasTarget)
    {
        
decl target_list[MAXPLAYERS], target_countbool:tn_is_ml;
        
        if ((
target_count ProcessTargetString(
                
arg,
                
client,
                
target_list,
                
MAXPLAYERS,
                
COMMAND_FILTER_CONNECTED,
                
target_name,
                
sizeof(target_name),
                
tn_is_ml)) <= 0)
        {
            
ReplyToTargetError(clienttarget_count);
            return 
Plugin_Handled;
        }
        
        
        for (new 
0target_counti++)
        {
            if (
amount == 1)
            {
            
SpeedEnabled[target_list[i]] = false;
            
Multi[target_list[i]] = amount;
            }
            else
            {
            
SpeedEnabled[target_list[i]] = true;
            
Multi[target_list[i]] = amount;
            }
        }
        
        if (
amount == 1)
        {
            
ReplyToCommand(client"[SM] ROF disabled for %s"target_name);
        }
        else
        {
            
ReplyToCommand(client"[SM] ROF set to: %s for %s"arg2target_name);
        }
    }
    else
    {
        if (
amount == 1)
        {
        
SpeedEnabled[client] = false;
        
Multi[client] = amount;
        
ReplyToCommand(client"[SM] ROF disabled");
        }
        else
        {
        
SpeedEnabled[client] = true;
        
Multi[client] = amount;
        
ReplyToCommand(client"[SM] ROF set to: %s"arg);
        }
    }
    
    
    return 
Plugin_Handled;
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
SpeedEnabled[client] && Multi[client] != 1.0)
    {
        if (
buttons IN_ATTACK2)
        {
            new 
ent GetEntDataEnt2(clientOffAW);
            if(
ent != -1)
            {
                new 
String:weap[50];
                
GetEdictClassname(entweapsizeof(weap));
                if(
strcmp(weap"tf_weapon_sniperrifle") == && GetConVarInt(g_hcvarSniperScope) == 0)
                {
                    
InAttack[client] = false;
                    return 
Plugin_Continue;
                }
                
                if (
strcmp(weap"tf_weapon_particle_cannon") == 0)
                {
                    new 
Float:charge GetEntPropFloat(entProp_Send"m_flChargeBeginTime");
                    new 
Float:chargemod charge-4.0;
                    if (
charge != && LastCharge[client] != chargemod)
                    {
                        
LastCharge[client] = chargemod;
                        
SetEntPropFloat(entProp_Send"m_flChargeBeginTime"chargemod);
                    }
                }
            }
        }
        
        if (
buttons IN_ATTACK || buttons IN_ATTACK2)
        {
            new 
ent GetEntDataEnt2(clientOffAW);
            if(
ent != -1)
            {
                new 
String:weap[50];
                
GetEdictClassname(entweapsizeof(weap));
                if(
strcmp(weap"tf_weapon_compound_bow") == && GetConVarInt(g_hcvarHuntsman) == 0)
                {
                    
InAttack[client] = false;
                    return 
Plugin_Continue;
                }
            }
            
InAttack[client] = true;
        }
        else
        {
            
InAttack[client] = false;
        }
    }
    return 
Plugin_Continue;
}

public 
OnGameFrame()
{
    for(new 
i=1i<=MaxClientsi++)
    {
        if (
SpeedEnabled[i] && InAttack[i])
        {
            if(
IsClientInGame(i) && IsPlayerAlive(i))
            {
                
ModRateOfFire(iMulti[i]);
            }
        }
    }
}

stock ModRateOfFire(clientFloat:Amount)
{
    new 
ent GetEntDataEnt2(clientOffAW);
    if (
ent != -1)
    {
        new 
Float:m_flNextPrimaryAttack GetEntPropFloat(entProp_Send"m_flNextPrimaryAttack");
        new 
Float:m_flNextSecondaryAttack GetEntPropFloat(entProp_Send"m_flNextSecondaryAttack");
        if (
Amount 12)
        {
            
SetEntPropFloat(entProp_Send"m_flPlaybackRate"12.0);
        }
        else
        {
            
SetEntPropFloat(entProp_Send"m_flPlaybackRate"Amount);
        }
        
        new 
Float:GameTime GetGameTime();
        
        new 
Float:PeTime = (m_flNextPrimaryAttack GameTime) - ((Amount 1.0) / 50);
        new 
Float:SeTime = (m_flNextSecondaryAttack GameTime) - ((Amount 1.0) / 50);
        new 
Float:FinalP PeTime+GameTime;
        new 
Float:FinalS SeTime+GameTime;
        
        
        
SetEntPropFloat(entProp_Send"m_flNextPrimaryAttack"FinalP);
        
SetEntPropFloat(entProp_Send"m_flNextSecondaryAttack"FinalS);
    }

__________________
Want to check my plugins ?
Arkarr 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 20:10.


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