IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Fixing HandleCommand_JoinClass( undefined ) - invalid class name.
twistedeuphoria
post Jun 24 2009, 11:16 PM
Post #1


Newbie
*

Group: Members
Posts: 1
Joined: 24-June 09
Member No.: 1,586



Hello, I see you had trouble with getting "HandleCommand_JoinClass( undefined ) - invalid class name" spammed in console and was wondering how you fixed it. I'm getting the same thing with a sourcemod fake client plugin I'm playing with.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Cheeseh
post Jul 5 2009, 12:03 AM
Post #2


Admin
*****

Group: Admin
Posts: 3,056
Joined: 11-September 03
From: uk
Member No.: 1



QUOTE(twistedeuphoria @ Jun 25 2009, 12:16 AM) *

Hello, I see you had trouble with getting "HandleCommand_JoinClass( undefined ) - invalid class name" spammed in console and was wondering how you fixed it. I'm getting the same thing with a sourcemod fake client plugin I'm playing with.

this was never really fixed as such. The only way to fix it was to get the bot to join a class and team.

CODE

void CBotFortress :: selectTeam ()
{
    char buffer[32];

    int team = randomInt(1,2);

    sprintf(buffer,"jointeam %d",team);

    helpers->ClientCommand(m_pEdict,buffer);
}

void CBotFortress :: selectClass ()
{
    char buffer[32];
    TF_Class _class;

    if ( m_iDesiredClass == 0 )
        _class = (TF_Class)randomInt(1,9);
    else
        _class = (TF_Class)m_iDesiredClass;

    m_iClass = _class;

    if ( _class == TF_CLASS_SCOUT )
    {
        sprintf(buffer,"joinclass scout");
    }
    else if ( _class == TF_CLASS_ENGINEER )
    {
        sprintf(buffer,"joinclass engineer");
    }
    else if ( _class == TF_CLASS_DEMOMAN )
    {
        sprintf(buffer,"joinclass demoman");
    }
    else if ( _class == TF_CLASS_SOLDIER )
    {
        sprintf(buffer,"joinclass soldier");
    }
    else if ( _class == TF_CLASS_HWGUY )
    {
        sprintf(buffer,"joinclass heavyweapons");
    }
    else if ( _class == TF_CLASS_MEDIC )
    {
        sprintf(buffer,"joinclass medic");
    }
    else if ( _class == TF_CLASS_SPY )
    {
        sprintf(buffer,"joinclass spy");
    }
    else if ( _class == TF_CLASS_PYRO )
    {
        sprintf(buffer,"joinclass pyro");
    }
    else
    {
        sprintf(buffer,"joinclass sniper");
    }
    helpers->ClientCommand(m_pEdict,buffer);
}
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 03:06 AM