AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Saved ya (https://forums.alliedmods.net/showthread.php?t=319466)

EFFx 11-02-2019 14:46

Saved ya
 
2 Attachment(s)
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


https://i.imgur.com/D7BGJDg.png





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.

iclassdon 11-02-2019 16:10

Re: Saved ya
 
This looks really cool. I will give it a try.

iclassdon 11-02-2019 16:54

Re: Saved ya
 
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.

EFFx 11-02-2019 17:01

Re: Saved ya
 
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.

iclassdon 11-02-2019 17:22

Re: Saved ya
 
Ok I'll give it a try. With the amount of carnage in deathmatch a little saving just might work.

tarsisd2 12-12-2019 14:24

Re: Saved ya
 
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


^SmileY 12-12-2019 14:48

Re: Saved ya
 
need to check if entity is connected at client_PreThink

HamletEagle 12-12-2019 15:31

Re: Saved ya
 
Quote:

Originally Posted by ^SmileY (Post 2676738)
need to check if entity is connected at client_PreThink

It's done already.

^SmileY 12-12-2019 17:20

Re: Saved ya
 
Quote:

Originally Posted by HamletEagle (Post 2676742)
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

EFFx 12-14-2019 23:46

Re: Saved ya
 
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.

HamletEagle 12-15-2019 16:52

Re: Saved ya
 
Quote:

Originally Posted by EFFx (Post 2676979)
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.

I know what he meant, but it's not the case. get_players can't return invalid players, that's the whole point of it.
He should post the actual error log.

tarsisd2 12-16-2019 08:48

Re: Saved ya
 
Quote:

Originally Posted by HamletEagle (Post 2677063)
I know what he meant, but it's not the case. get_players can't return invalid players, that's the whole point of it.
He should post the actual error log.

what do you mean the actual error log? that was the actual error log, just the same thing over and over again in 4.487 lines with the same error each log

bad_boy 12-16-2019 12:43

Re: Saved ya
 
Quote:

Originally Posted by tarsisd2 (Post 2676735)
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



I think your problem might be coming from this, the teams are backwards.
Code:

(get_user_team(id) == 1) ? "CT" : "TERRORIST")
change ------>
(get_user_team(id) == 1) ? "TERRORIST" : "CT")


EFFx 12-19-2019 16:03

Re: Saved ya
 
There's nothing to do with that, with that check, i'm trying to see if there's more than one player on the enemy team, so if I try to shot one, the other teammate will be able to save him.

@tarsisd2, try the new code, this error may have been fixed.

EFFx 06-22-2022 05:17

Re: Saved ya
 
Added a little forward to detect when someone saves anybody, so people can give custom rewards ^^.

PHP Code:

/*
* @iKiller                        who saved
* @iTeammateID             who got saved
* @iVictimID                   who got killed
*/
saved_ya(iKilleriTeammateIDiVictimID



All times are GMT -4. The time now is 06:31.

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