AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CSS/CSGO] Only Headshot (https://forums.alliedmods.net/showthread.php?t=234169)

Bara 01-26-2014 10:09

[CSS/CSGO] Only Headshot
 
1 Attachment(s)
You like this plugin or my work? Support is not a crime.
https://www.paypalobjects.com/en_US/..._donate_SM.gif

Description:
This is a Only Headshot Plugin for CSS and CSGO. Settings: You are able to choose what and how many weapons deal damage ( onlyhs_allow_oneweapon must be 1 ). Also there is the possibility that the weapons you have chosen are always killing with one shot.

Supported Games:
  • Counter-Strike: Source
  • Counter-Strike: Global Offensive

Features:
  • Only Headshot
  • One Shot
  • Damage weapons are configurable

CVars: Enable/Disable Commands
  • onlyhs_enable - Enable / Disalbe Simple Only HeadShot Plugin (Default: 1)
  • onlyhs_oneshot - Enable / Disable kill enemy with one shot (Default: 0)
  • onlyhs_allow_weapons - Which weapon should be permitted ( Without 'weapon_' ) (Default: deagle)
  • onlyhs_allow_grenade - Enable / Disalbe Grenade Damage (Default: 0)
  • onlyhs_allow_world - Enable / Disalbe World Damge (Default: 0)
  • onlyhs_allow_knife - Enable / Disalbe Knife Damage (Default: 0)
  • onlyhs_allow_blood Enable / Disable No Blood (Default: 0)
  • onlyhs_allow_blood_splatter Enable / Disable No Blood Splatter (Default: 0)
  • onlyhs_allow_blood_splash Enable / Disable No Blood Splash (Default: 0)

Requirements:
  • SourceMod (1.7+)

Changelog:
  • Fixed bug with damagetype (Thanks Anjin)
  • Fixed bug with weapon string (Thanks Anjin)
ToDo:
  • None

Known Issues:
  • None

Thanks to:
Download:
https://github.com/Bara/OnlyHS

Bara 01-26-2014 16:58

Re: Simple Only Headshot
 
Changelog - 1.2.0
  • Added Team Fortress 2 Support ( not tested )
  • Added Day of Defeat: Source Support ( not tested )
  • Added Grenade Damage Support
  • Added Melee Damage Support
  • Added World Damage Support ( not tested )

Root_ 01-26-2014 19:06

Re: [ANY] Simple Only Headshot
 
Nice plugin! :up:
I have some recommendations about the code.
1) At first dont use GetGameFolderName to detect game, use GetEngineVersion() instead (or this stock).
2) Then OnPluginStart at line 70 add IsClientInGame(i), otherwise you may have some errors if no players on a server and you decided to reload plgin.
3) TraceAttack differs from OnTakeDamage not only by different parameters, but also it can make bullets go through player - this way you should return Plugin_Handled instead of doing damage = 0.0 and returning Plugin_Changed.
4) You can ignore weapon_ prefix due to performance purposes using this way
Code:
if(StrEqual(weapon[7], "knife"))
Or for TF2 use this
Code:
if(StrEqual(weapon[10], "bat")
Or you can try to check if (inflictor == GetPlayerWeaponSlot(attacker, 2)), which is melee weapon and not compare melee classnames at all.
5) Use global strings for weapons instead of declaring it all the time from ConVar within TraceAttack hook.
6) For DoD:S you can add one more melee weapon: weapon_punch.
7) At line 214 use damage = float(GetClientHealth(victim)) instead of current one.

Bara 01-26-2014 20:23

Re: [ANY] Simple Only Headshot
 
Thanks, Root_!
I update this plugin in the next hours / days.

Root_ 01-27-2014 02:58

Re: [ANY] Simple Only Headshot
 
Bara I forgot to note that grenades damage cannot be changed in TraceAttack hook, it fires only when grenade collides with a player, so you should add OnTakeDamage hook or dont use grenades at all.

Bara 02-01-2014 11:04

Re: [CSS/CSGO] Only Headshot
 
Changelog - 1.3.0:
  • Removed Team Fortress 2 Support ( No time for this )
  • Removed Day of Defeat: Source Support ( No time for this )
  • Code Optimization ( Thanks: Root_ and Peace-Maker)

Peace-Maker 02-02-2014 16:51

Re: [CSS/CSGO] Only Headshot
 
Looks good. Let's hope that (1<<30) damage bit is really only used for headshot damage in cstrike :)

Bara 02-02-2014 17:01

Re: [CSS/CSGO] Only Headshot
 
Quote:

Originally Posted by Peace-Maker (Post 2094482)
Looks good. Let's hope that (1<<30) damage bit is really only used for headshot damage in cstrike :)

Thanks!

Changelog - 1.3.1:
  • Removed SDHKUnhook

nguyenbaodanh 02-20-2014 02:25

Re: [CSS/CSGO] Only Headshot
 
I put in plugin.hsonly.cfg
Quote:

onlyhs_allow_weapon "ak47;m4a1;m4a1_silencer;sg556;aug;galilar;fa mas;ssg08;awp;p90;nova;xm1014;sawedoff;mag7;g 3sg1;scar20;glock;p250;cz75a;usp_silencer;fiv eseven;deagle;elite;tec9;hkp2000"
I want to allow those guns ,is this setting correct ? 'cos it not working on my server

Bara 02-20-2014 08:18

Re: [CSS/CSGO] Only Headshot
 
Quote:

Originally Posted by nguyenbaodanh (Post 2102386)
I put in plugin.hsonly.cfg

I want to allow those guns ,is this setting correct ? 'cos it not working on my server

Use this:
onlyhs_oneweapon 0 (Enable / Disalbe Only One Weapon Damage)


All times are GMT -4. The time now is 09:29.

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