Raised This Month: $51 Target: $400
 12% 

TK Manager little fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
playhardloveenemy
Member
Join Date: Dec 2015
Old 11-16-2016 , 17:18   TK Manager little fix
Reply With Quote #1

Hallo!

I'm using "TK Manager" by Stevo.TVR. It's working perfect in my CS GO server.
BUT, players can gain points for team kills, but for team wounds they don't. It shound count for every 10 (in my server) team wounds 1 point.

That's the error log:

PHP Code:
L 11/16/2016 18:45:19SourceMod error session started
L 11
/16/2016 18:45:19Info (map "de_inferno") (file "errors_20161116.log")
L 11/16/2016 18:45:19: [SMException reportedInvalid hook callback specified for game event "player_hurt"
L 11/16/2016 18:45:19: [SMBlamingtkmanager.smx
L 11
/16/2016 18:45:19: [SMCall stack trace:
L 11/16/2016 18:45:19: [SM]   [0UnhookEvent
L 11
/16/2016 18:45:19: [SM]   [1Line 155, /home/forums/content/files/4/2/7/5/9/33356.attach::OnConVarChanged
L 11
/16/2016 18:45:28Error log file session closed
Cvar: sm_tk_numtw = CreateConVar("sm_tk_numtw", "10", "Number of team wounds to add 1 TK point (0 to disable team wound detection)", _, true, 0.0);

And that's the problem line, i think:

PHP Code:
public OnConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if(
convar == sm_tk_numtw)
    {
        new 
oldVal StringToInt(oldValue), newVal StringToInt(newValue);
        if(
oldVal <= && newVal 0)
        {
            
HookEvent("player_hurt"Event_PlayerHurt);
        }
        else if(
newVal <= && oldVal 0)
        {
            
UnhookEvent("player_hurt"Event_PlayerHurt);
        }
    }

The thing is that i don't know how to fix it, i'm not a scripter, i can just read and understand them.

Thank you already!
playhardloveenemy is offline
StevoTVR
Senior Member
Join Date: Oct 2008
Old 11-23-2016 , 16:01   Re: TK Manager little fix
Reply With Quote #2

I'm trying to figure out why it is throwing that exception, but that should only happened when sm_tk_numtw is set to 0. Are you sure you don't have sm_tk_numtw 0 in a config file somewhere?

Last edited by StevoTVR; 11-23-2016 at 20:04.
StevoTVR is offline
StevoTVR
Senior Member
Join Date: Oct 2008
Old 11-23-2016 , 20:07   Re: TK Manager little fix
Reply With Quote #3

The error seems to be caused by server hibernation. Try this version and see if it still happens. Make sure that sm_tk_numtw is set greater than 0 before testing team wound detection.
Blocked Attachments
File Type: smx tkmanager.smx
StevoTVR is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 11-23-2016 , 20:24   Re: TK Manager little fix
Reply With Quote #4

StevoTVR, please post source code, not just the binary.
__________________
sneaK is offline
StevoTVR
Senior Member
Join Date: Oct 2008
Old 11-23-2016 , 20:56   Re: TK Manager little fix
Reply With Quote #5

https://github.com/ultramega/sourcem...r/tkmanager.sp
StevoTVR is offline
playhardloveenemy
Member
Join Date: Dec 2015
Old 11-24-2016 , 11:07   Re: TK Manager little fix
Reply With Quote #6

Yes, the plugin is counting team wounds now, no erros in log file (the updated version)! Before that sm_tk_numtw was set to 10 in my cfg. and set to 3 by default in the sp. file, so "0" was not the problem.
Is there a chance to slay people who are trying to kill you in spawn the first 10-15 secound of the round ? Like spawn protection... Would be great!
Thank you for your fast replay and fix!
playhardloveenemy is offline
StevoTVR
Senior Member
Join Date: Oct 2008
Old 11-24-2016 , 19:22   Re: TK Manager little fix
Reply With Quote #7

Quote:
Originally Posted by playhardloveenemy View Post
Is there a chance to slay people who are trying to kill you in spawn the first 10-15 secound of the round ? Like spawn protection... Would be great!
I think that is beyond the scope of this plugin. I suggest you use one of the existing plugins made specifically for spawn protection.
StevoTVR is offline
playhardloveenemy
Member
Join Date: Dec 2015
Old 11-25-2016 , 09:40   Re: TK Manager little fix
Reply With Quote #8

The other plugins are troubled and full with useless cvars (in my case). One of them eaven used to crash my server.
I'll stick with your plugin.
playhardloveenemy is offline
Reply



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 05:37.


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