AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   TK Manager little fix (https://forums.alliedmods.net/showthread.php?t=290565)

playhardloveenemy 11-16-2016 17:18

TK Manager little fix
 
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!

StevoTVR 11-23-2016 16:01

Re: TK Manager little fix
 
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?

StevoTVR 11-23-2016 20:07

Re: TK Manager little fix
 
1 Attachment(s)
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.

sneaK 11-23-2016 20:24

Re: TK Manager little fix
 
StevoTVR, please post source code, not just the binary.

StevoTVR 11-23-2016 20:56

Re: TK Manager little fix
 
https://github.com/ultramega/sourcem...r/tkmanager.sp

playhardloveenemy 11-24-2016 11:07

Re: TK Manager little fix
 
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!

StevoTVR 11-24-2016 19:22

Re: TK Manager little fix
 
Quote:

Originally Posted by playhardloveenemy (Post 2472338)
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.

playhardloveenemy 11-25-2016 09:40

Re: TK Manager little fix
 
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.


All times are GMT -4. The time now is 17:07.

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