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

How to write a plugin that adjusts the damage and recoil values of your own weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fixer0001
New Member
Join Date: Mar 2023
Old 03-29-2023 , 09:35   How to write a plugin that adjusts the damage and recoil values of your own weapon?
Reply With Quote #1

I have a l4d2 server, want to play a little fun with friends
How to write a plugin that adjusts the damage and recoil values of your own weapon.

Enter the server, type "!Ac" in the chat box to change the specific weapon data (only valid for yourself) to the following self-defined value
Type "!Acstop" to restore the weapon values to the server's default state.

public void OnPluginStart()
{
RegAdminCmd("sm_Ac", Cmd_Ac, ADMFLAG_RCON,"Ac command");
RegAdminCmd("sm_Acstop", Cmd_Acstop, ADMFLAG_RCON, "Ac command");
}



My foundation is not good, I learned sourcemod a few months through youtube , but also can not write this plug-in, Any recommendations for good tutorials? I have a l4d2 server, want to play a little fun with friends, how to write the next? Thank you in advance!

Last edited by fixer0001; 03-29-2023 at 09:54.
fixer0001 is offline
fixer0001
New Member
Join Date: Mar 2023
Old 03-29-2023 , 09:44   Re: How to write a plugin that adjusts the damage and recoil values of your own weapo
Reply With Quote #2

For example, I want to change the value of my smg weapon to the following


sm_weapon smg_silenced VerticalPunch 0.0
sm_weapon smg_silenced damage 31
sm_weapon smg_silenced spreadpershot 0.16
sm_weapon smg_silenced maxmovespread 1.69
sm_weapon smg_silenced rangemod 0.70
sm_weapon smg_silenced reloadduration 1.92

Define it directly like this?

#define sm_weapon smg_silenced VerticalPunch 0.0
#define sm_weapon smg_silenced damage 31
#define xxx
fixer0001 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 12:52.


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