Raised This Month: $114 Target: $400
 28% 

Mortal Headshot v0.1.1


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff        Approver:   ConnorMcLeod (74)
eXtrem
Member
Join Date: Jul 2011
Old 07-31-2011 , 23:03   Mortal Headshot v0.1.1
Reply With Quote #1

Mortal Headshot
- v0.1.1


In case of headshot, you will kill in one shoot the enemy.
You can enable/disable this for each weapon.



| Command
  • mh_weapon < weapon shortname > < value > (ADMIN_KICK flag is needed)
weapon shortname : See list below
value : 0 is disabled ; 1 is enabled

Weapons short names are :
  • p228
  • scout
  • xm1014
  • mac10
  • aug
  • elite
  • fiveseven
  • ump45
  • sg550
  • galil
  • famas
  • usp
  • glock18
  • awp
  • mp5navy
  • m249
  • m3
  • m4a1
  • tmp
  • g3sg1
  • deagle
  • sg552
  • ak47
  • knife
  • p90


| Changelog
v0.1.1 - Cleaning all code
v0.0.1 - First Release


| Save Value
You want to save your settings ?
Put commands in ./amxmodx/amxx.cfg file

Examples :
* mh_weapon < weapon shortname > < value >

mh_weapon knife 1
mh_weapon glock 1
mh_weapon usp 0



Big thanks to Arkshine for helping me cleaning the code !


| Download
Attached Files
File Type: sma Get Plugin or Get Source (MortalHeadshot.sma - 1990 views - 1.6 KB)

Last edited by eXtrem; 01-15-2012 at 11:15. Reason: Cleaning code
eXtrem is offline
TGCorporation
Junior Member
Join Date: Apr 2011
Old 08-01-2011 , 05:31   Re: Mortal Headshot v0.0.1
Reply With Quote #2

Cool plugin, in my server, all the people says: This server dont register?

Now i put this on my server. They dont say that anymore .

+k for you
TGCorporation is offline
eXtrem
Member
Join Date: Jul 2011
Old 08-01-2011 , 05:54   Re: Mortal Headshot v0.0.1
Reply With Quote #3

Thank you !
eXtrem is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-01-2011 , 06:00   Re: Mortal Headshot v0.0.1
Reply With Quote #4

PHP Code:
public HamTraceAttackvictim attacker Float:damage Float:tr[3] , traceresult dmgbits )
{
    if( !
IsPlayerattacker ) || !IsPlayervictim ) || victim == attacker )
        return 
HAM_IGNORED
The victim is player always!

PHP Code:
    {
        
SetHamParamFloatdamage 9999.9 )
    } 
Try to put a fix damage value because if there's much than the 32 bits limit the bugs does appear...
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
eXtrem
Member
Join Date: Jul 2011
Old 08-01-2011 , 06:06   Re: Mortal Headshot v0.0.1
Reply With Quote #5

Quote:
Originally Posted by claudiuhks View Post
PHP Code:
public HamTraceAttackvictim attacker Float:damage Float:tr[3] , traceresult dmgbits )
{
    if( !
IsPlayerattacker ) || !IsPlayervictim ) || victim == attacker )
        return 
HAM_IGNORED
The victim is player always!
What ? I check if the attacker is a player, if the victim is a player too, and if the attacker is not a victim too. What is the problem ?

Quote:
Originally Posted by claudiuhks View Post
PHP Code:
    {
        
SetHamParamFloatdamage 9999.9 )
    } 
Try to put a fix damage value because if there's much than the 32 bits limit the bugs does appear...
Okay, fixed.
eXtrem is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-01-2011 , 06:12   Re: Mortal Headshot v0.0.1
Reply With Quote #6

PHP Code:
        if( equalszWeapon "weapon_smokegrenade" ) || equalszWeapon "weapon_flashbang" ) || equalszWeapon "weapon_hegrenade" ) , equalszWeapon "weapon_c4" ) )
        {
            return 
PLUGIN_HANDLED
        

This is useless, if you really want to check, then check weaponid it is faster.
No check result in the array to be filled, it's not really a problem.


For victim check, you register the ham forward with classname "player", so victim can't be any other entity than a player, that's why the check is useless.
__________________
- tired and retired -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-01-2011 , 06:14   Re: Mortal Headshot v0.0.1
Reply With Quote #7

Quote:
What ? I check if the attacker is a player, if the victim is a player too, and if the attacker is not a victim too. What is the problem ?
He says just the check if victim is a player or not is pointless since your register the forward with "player" and the victim can be only a player anyway.
__________________
Arkshine is offline
Old 08-01-2011, 06:15
ConnorMcLeod
This message has been deleted by Arkshine. Reason: Bon, alors, t'as pas fais ton caca du matin ou quoi ?
eXtrem
Member
Join Date: Jul 2011
Old 08-01-2011 , 06:18   Re: Mortal Headshot v0.0.1
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
PHP Code:
        if( equalszWeapon "weapon_smokegrenade" ) || equalszWeapon "weapon_flashbang" ) || equalszWeapon "weapon_hegrenade" ) , equalszWeapon "weapon_c4" ) )
        {
            return 
PLUGIN_HANDLED
        

This is useless, if you really want to check, then check weaponid it is faster.
No check result in the array to be filled, it's not really a problem.


For victim check, you register the ham forward with classname "player", so victim can't be any other entity than a player, that's why the check is useless.
Ok, fixed. I have checked with weaponid.

Quote:
Originally Posted by Arkshine View Post
He says just the check if victim is a player or not is pointless since your register the forward with "player" and the victim can be only a player anyway.
I didn't understand that, sorry.
eXtrem is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-01-2011 , 06:27   Re: Mortal Headshot v0.0.1
Reply With Quote #9

PHP Code:
if( !IsPlayerattacker ) || !IsPlayervictim ) || victim == attacker 
->

PHP Code:
if( !IsPlayerattacker ) || victim == attacker 
I am not sure, but don't you need to check if attacker is connected?
__________________
Accepting paid work for clans and communities. !Plugins & Models!
Don't hesitate to contact me.
bibu is offline
eXtrem
Member
Join Date: Jul 2011
Old 08-01-2011 , 06:29   Re: Mortal Headshot v0.0.1
Reply With Quote #10

Quote:
Originally Posted by bibu View Post
PHP Code:
if( !IsPlayerattacker ) || !IsPlayervictim ) || victim == attacker 
->

PHP Code:
if( !IsPlayerattacker ) || victim == attacker 
Already done, refresh, I didn't update the sma.
Quote:
Originally Posted by bibu View Post
I am not sure, but don't you need to check if attacker is connected?
If the attacker is a player, he is connected.
eXtrem is offline
Reply


Thread Tools
Display Modes

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 11:54.


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