Raised This Month: $32 Target: $400
 8% 

One-Shot Multikill Detection


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-03-2017 , 19:17   One-Shot Multikill Detection
Reply With Quote #1

One-Shot Multikill Detection


First release: 03/01/2017
Last update: 04/15/2017



- Description
This plugin allow players to see if someone has killed two or more players just with one bullet.

- Cvars
Code:
// (c) One-Shot MultiKill Detection

// Used for check the type of message that will show when someone
// kill two or more players with one bullet
// 2 = CHAT, 1 = LOG MESSAGE, 0 = HUD MESSAGE
osmd_messagetype "0"

// Used for turn on/off the plugin
osmd_enabled "1"
- Change Log
Spoiler


- How to install?
Put the .sma file on dir/addons/amxmodx/scripting
Put the .amxx file on dir/addons/amxmodx/plugins
Put the folder OneShotMD on dir/addons/amxmodx/configs
Put the file osm_detector.txt on dir/addons/amxmodx/data/lang

After it, put the plugin's name on plugins.ini
Attached Files
File Type: txt osm_detector.txt (4.6 KB, 266 views)
File Type: inc oneshotmd.inc (173 Bytes, 201 views)
File Type: sma Get Plugin or Get Source (OneShotMD.sma - 765 views - 6.8 KB)
File Type: cfg osmd_cvars.cfg (274 Bytes, 184 views)
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 04-15-2017 at 20:26.
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-03-2017 , 20:16   Re: Two or more for one detect
Reply With Quote #2

litttle horribile for the moment ( i mean the code and the indentation ) .. but i'm waiting :p

Also what about Laser Mod ? You should focus to only 1 plugin until you get something with it ...

Can pleaseeeeeee name it "kill two birds with one stone" : ) )
__________________
Project: Among Us

Last edited by Craxor; 01-03-2017 at 20:18.
Craxor is offline
Send a message via ICQ to Craxor
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-03-2017 , 20:21   Re: Two or more for one detect
Reply With Quote #3

Sorry about the code, its my style
Sorry about the indentation, here in my Text editor* its nice.

I hate the name you said.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-03-2017 at 22:41.
EFFx is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-03-2017 , 21:30   Re: Two or more for one detect
Reply With Quote #4

Quote:
Originally Posted by EFFx View Post
here in my compiler its nice.
Text editor*, compiler is something else.
Indentation looks alright to me, not sure what Craxor is talking about.

Quote:
Originally Posted by EFFx View Post
I hate the name you said.
"Kill two birds with one stone" is a very popular phrase in English language. Naming your plugin "Two birds, one stone" (or similar) sounds much better and will be much more recognizable. Your current name actually is awful and doesn't make much sense. Even just "One-Shot Multikill Detection" would sound much better.


As for my suggestions, you should add a multiplugin forward in my opinion, so other plugins could detect such kills (with parameters: who did it, weapon used, array of victim ids, how many victims, array of "was it headshot" booleans for every victim). This would be useful for giving bonus XP and such in other mods, for example. That means that you should add an option to your cvar to disable the message completely and use this only as an API.

Last edited by klippy; 01-03-2017 at 21:33.
klippy is offline
aEEk
Member
Join Date: May 2012
Location: Romania
Old 01-03-2017 , 21:50   Re: Two or more for one detect
Reply With Quote #5

It's possible to make this plugin to look like csgo? I mean that 'dead icons' in right corner (I'm not so advanced in coding, maybe is possible using DLL). Did you understand?

PS: Thanks for source

Last edited by aEEk; 01-03-2017 at 21:51.
aEEk is offline
Send a message via Yahoo to aEEk Send a message via Skype™ to aEEk
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-03-2017 , 21:54   Re: Two or more for one detect
Reply With Quote #6

Quote:
One-Shot Multikill Detection
Its look much better for me

Quote:
Originally Posted by aEEk View Post
PS: Thanks for source
I appreciate it

That was the first name I found, but I was going to change him, I just was searching a better than the original
Sorry about the popular phrase on english, I don't knew it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-03-2017 at 21:59.
EFFx is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-03-2017 , 22:27   Re: One-Shot Multikill Detection
Reply With Quote #7

Quote:
Originally Posted by aEEk View Post
It's possible to make this plugin to look like csgo? I mean that 'dead icons' in right corner (I'm not so advanced in coding, maybe is possible using DLL). Did you understand?

PS: Thanks for source
I don't know nothing from CSGO, but you can make a thread on SourceMod requesting that.

Quote:
Originally Posted by KliPPy View Post
As for my suggestions, you should add a multiplugin forward in my opinion, so other plugins could detect such kills (with parameters: who did it, weapon used, array of victim ids, how many victims, array of "was it headshot" booleans for every victim). This would be useful for giving bonus XP and such in other mods, for example. That means that you should add an option to your cvar to disable the message completely and use this only as an API.
I just see it right now, its a great idea and I had that idea too.

Edit:
But how suggest you to I add this? Because the event DeathMsg will run only when someone has killed someone. If someone want to give a bonus for who has killed more than 1 player with one bullet, need just add on my source code.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-03-2017 at 22:42.
EFFx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-03-2017 , 23:41   Re: One-Shot Multikill Detection
Reply With Quote #8

Line 303 (shown below) is wrong and will give an error every time.

PHP Code:
set_pcvar_num(iMessageType0
Also, in GetMessageType(), you should use a switch for iMessageType.

More importantly, using GetMessageType() to populate a global variable every time that you use that global variable is unnecessary and confusing (confusing particularly because of the name). Simply do this:

PHP Code:
MessageTypes:GetMessageType()
{
    new 
MessageTypes:iMessageType MessageTypes:get_pcvar_num(cVars[pCvarMessageType])
    new 
MessageTypes:returnValue
    
    
switch( iMessageType )
    {
        case 
CHATHUDLOG:
        {
            
returnValue iMessageType
        
}
        default:
        {
            
returnValue CHAT
            
// set_pcvar_num(cVars[pCvarMessageType], _:CHAT) // Not entirely necessary
        
}
    }

    return 
returnValue

Now, the name makes more sense and you would use it like this:

PHP Code:
SendMessage(0GetMessageType(), /*...*/
This:

PHP Code:
    register_plugin
    
(
    .
plugin_name PLUGIN,
    .
version VERSION,
    .
author AUTHOR
    

Is formatted unnecessarily and is ugly. Don't use dot notation unless you are going to be skipping several parameters. If you are using all parameters, simply supply all three parameters normally. Also, there is no real advantage to putting such a short command on multiple lines. Use a single line, even with dot notation, it will be shorter than many other lines of your code.

About indentation, the only thing that is ugly is that there are three tabs after an equal sign in an assignment statement. Trying to line things up with multiple tabs is guaranteed to look bad in someone's editor. Most of the time, lining assignment statements up like this is adds no value.
__________________
fysiks is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-04-2017 , 00:22   Re: One-Shot Multikill Detection
Reply With Quote #9

Sorry about the error, it doesn't give an error for me.

PHP Code:
MessageTypes:GetMessageType() 

    new 
MessageTypes:iMessageType MessageTypes:get_pcvar_num(cVars[pCvarMessageType]) 
    new 
MessageTypes:returnValue 
     
    
switch( iMessageType 
    { 
        case 
CHATHUDLOG
        { 
            
returnValue iMessageType 
        

        default: 
        { 
            
returnValue CHAT 
            
// set_pcvar_num(cVars[pCvarMessageType], _:CHAT) // Not entirely necessary 
        

    } 

    return 
returnValue 

Hm, I was searching how can I use that function like this:

PHP Code:
new szMessageTypeName[32]
GetMessageType(szMessageTypeName,charsmax(szMessageTypeName)) 
But I don't know how do that.

This,

PHP Code:
SendMessage(0GetMessageType(), /*...*/
That give an error.

Look what I made:

PHP Code:
MessageTypes:GetMessageType(MessageTypes:returnValue

    new 
MessageTypes:iMessageType MessageTypes:get_pcvar_num(cVars[pCvarMessageType]) 
     
    switch(
iMessageType
    { 
        case 
CHATHUDLOG
        { 
            
returnValue iMessageType 
        

        default: 
        { 
            
returnValue CHAT 
        

    } 
    return 
returnValue 

PHP Code:
SendMessage(0,GetMessageType(MessageType),"^4%s^1's grenade killed^4 %d^1 players!",szName,iKills
The MessageTypes:MessageType is a global.

PHP Code:
SendMessage(const indexMessageTypes:MsgType,const message[],any:...) 
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-04-2017 at 00:27.
EFFx is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-04-2017 , 03:29   Re: One-Shot Multikill Detection
Reply With Quote #10

Quote:
Is formatted unnecessarily and is ugly. Don't use dot notation unless you are going to be skipping several parameters. If you are using all parameters, simply supply all three parameters normally. Also, there is no real advantage to putting such a short command on multiple lines. Use a single line, even with dot notation, it will be shorter than many other lines of your code.
Saying it's ugly is only a matter of subjectivity and should never be part of a review. Don't try to enforce your own style.
Also, about when one should use the dot or not, here it's just a style.

Quote:
Also, there is no real advantage to putting such a short command on multiple lines. Use a single line, even with dot notation, it will be shorter than many other lines of your code.
No one is doing that for practical advantages. I'm personally using that way of writting the register_plugin line as my signature, for visual purpose only.
__________________

Last edited by HamletEagle; 01-04-2017 at 03:29.
HamletEagle 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 20:13.


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