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

Saved ya


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 11-02-2019 , 14:46   Saved ya
Reply With Quote #1

Saved ya


- Description
- This plugin is based on a feature that CSGO has, that's when a player kill an enemy while another teammate is being killed or was about to be killed by him, it prints a message on the chat.

- Change log
Spoiler








Plugin's check explanation:
- If you hit someone and he/her is not seeing you, your id is catched by the plugin. If in an interval of time of 2 seconds someone kill you, he'll save the player who you've had hit before.
- If in a certain distance (closer enough) someone just saw you and another teammate killed him, that teammate will be considered a savior as well (the same, 2 seconds delay, otherwise the ID will be reseted).

Basically, it does the same as this - https://gist.github.com/sigsegv-mvm/...8284151423041b, the only difference is that my code is a little bit hacky, but works.
Attached Files
File Type: sma Get Plugin or Get Source (saved_ya.sma - 371 views - 5.3 KB)
File Type: sma Get Plugin or Get Source (saved_ya_api.sma - 114 views - 5.5 KB)
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 06-25-2022 at 00:55.
EFFx is offline
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 11-02-2019 , 16:10   Re: Saved ya
Reply With Quote #2

This looks really cool. I will give it a try.
iclassdon is offline
Send a message via MSN to iclassdon
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 11-02-2019 , 16:54   Re: Saved ya
Reply With Quote #3

I'm using it on deathmatch and it seems like I'm saving everyone from death.

Probably not best for CSDM I would like to try it on a 3 or 4 second interval.
iclassdon is offline
Send a message via MSN to iclassdon
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-02-2019 , 17:01   Re: Saved ya
Reply With Quote #4

Death Match is not a good idea to use it since most of the time you're confronting someone while another player is shooting at you, it's not recommended. So here's the deal:

Use sy_deathmatch_support 1 (default is 0) to block the client_PreThink code, so with that, you'll only save someone if an enemy has hit your teammate behind his back, it could make the save feature harder (maybe not that much) to happen.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 11-02-2019 at 17:08.
EFFx is offline
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 11-02-2019 , 17:22   Re: Saved ya
Reply With Quote #5

Ok I'll give it a try. With the amount of carnage in deathmatch a little saving just might work.
iclassdon is offline
Send a message via MSN to iclassdon
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 12-12-2019 , 14:24   Re: Saved ya
Reply With Quote #6

PHP Code:
L 12/12/2019 12:51:28Start of error session.
L 12/12/2019 12:51:28Info (map "de_dust2") (file "addons/amxmodx/logs/error_20191212.log")
L 12/12/2019 12:51:28: [ENGINEInvalid player 12 (not in-game)
L 12/12/2019 12:51:28: [AMXXDisplaying debug trace (plugin "saved_ya.amxx"version "1.0")
L 12/12/2019 12:51:28: [AMXXRun time error 10native error (native "is_visible")
L 12/12/2019 12:51:28: [AMXX]    [0saved_ya.sma::client_PreThink (line 122
tarsisd2 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-12-2019 , 14:48   Re: Saved ya
Reply With Quote #7

need to check if entity is connected at client_PreThink
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-12-2019 , 15:31   Re: Saved ya
Reply With Quote #8

Quote:
Originally Posted by ^SmileY View Post
need to check if entity is connected at client_PreThink
It's done already.
__________________
HamletEagle is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 12-12-2019 , 17:20   Re: Saved ya
Reply With Quote #9

Quote:
Originally Posted by HamletEagle View Post
It's done already.
No is not, the error itself is in like 122.
Guess that get_players with "a" flag do not return correct who is alive or just connected
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 12-14-2019 , 23:46   Re: Saved ya
Reply With Quote #10

Guess he meant inside the loop, I didn't know that get_players could return invalid players as well, that's odd. Anyway, I made some changes, it's already avaliable.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 03:25.


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