Raised This Month: $ Target: $400
 0% 

Debugging plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wiebbe
Junior Member
Join Date: Jul 2007
Old 07-01-2007 , 17:44   Debugging plugins
Reply With Quote #1

Hello all,

I have been working on a Zombiemaster plugin for a couple of day, which is a bit the same as the RPGx plugin for CS:S.

Somehow i have been able to award players with the healthbonus, but sometimes the server crashes very badly. But i just cant see why the plugin crashes.

How can i debug this the best? Its very hard to see where exactly it crashes :/
Wiebbe is offline
BAILOPAN
Join Date: Jan 2004
Old 07-01-2007 , 20:07   Re: Debugging plugins
Reply With Quote #2

What extensions does the plugin use?

Unfortunately debugging crashes isn't always easy. What operating system is the server?
__________________
egg
BAILOPAN is offline
Wiebbe
Junior Member
Join Date: Jul 2007
Old 07-02-2007 , 03:02   Re: Debugging plugins
Reply With Quote #3

The server is running on Windows 2003R2.

The only extention i include is:

#include <sourcemod>

One of the things i have been noticing is tha with using this piece of code:

Code:
public Event_roundrestart(Handle:event, const String:name[], bool:dontBroadcast)
{    

    LogMessage("[zmupgrades] Round restart reached");

    new maxplayers=GetMaxClients();

    for(new player=1;player<=maxplayers;player++)
    {
    if(IsClientConnected(player))
          {
        LogMessage("Round restart: Client connected reached");

        if (GetClientTeam(player) == 2) 
        {
            LogMessage("Round restart: Client team reached");

            healthBonus[player] = healthBonus[player] + 10;
        }
          }
    }
}
I added those logmessages to have atleast an idea where the server crashes on. Anyway, the odd thing is that sometimes i still get an error at this piece of code which says:

Native "GetClientTeam" reported: Client 2 is not in game

But that shouldnt be possible because i check if the player is connected?
Wiebbe is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-02-2007 , 08:05   Re: Debugging plugins
Reply With Quote #4

A player can be connected but not yet in the game. See IsClientInGame. You should check with it as well.
__________________
I'm a blast from the past!
ferret is offline
Wiebbe
Junior Member
Join Date: Jul 2007
Old 07-02-2007 , 11:17   Re: Debugging plugins
Reply With Quote #5

Wow, awesome ferret

It seems this really did fix it for me. I guess the plugin was trying to set the HP of someone that wasnt ingame and it made it crash. So far it seems to run very stable!
Wiebbe 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 15:20.


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