devicenull
12-04-2004, 23:19
class myadmin : public IServerPluginCallbacks, public IGameEventListener {
public:
myadmin();
~myadmin();
virtual bool Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory );
virtual PLUGIN_RESULT ClientCommand( edict_t *pEntity );
virtual void ClientPutInServer( edict_t *pEntity, char const *playername );
alevels lookUpAccess(char const *playerID);
private:
};
PLUGIN_RESULT myadmin::ClientCommand(edict_t *pEntity)
{
const char *pcmd = eng->Cmd_Argv(0);
Msg("myadmin::ClientCommand() got command %s\n",pcmd);
if ( !pEntity || pEntity->IsFree() )
{
return PLUGIN_CONTINUE;
}
if ( FStrEq( pcmd, "n_listadmins" ) )
{
if (g_accUsed == 0) {
eng->ClientPrintf(pEntity,"No admins loaded");
}
for (int i=0;i<g_accUsed;i++) {
char temp[512];
sprintf(temp,"%s /t %s",acc[i].steamid,acc[i].access);
eng->ClientPrintf(pEntity,temp);
}
return PLUGIN_STOP;
}
return PLUGIN_CONTINUE;
}
I have that stuff. But it wont catch an of the commands, I don't even get a myadmin::ClientCommand() got command %s\n
public:
myadmin();
~myadmin();
virtual bool Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory );
virtual PLUGIN_RESULT ClientCommand( edict_t *pEntity );
virtual void ClientPutInServer( edict_t *pEntity, char const *playername );
alevels lookUpAccess(char const *playerID);
private:
};
PLUGIN_RESULT myadmin::ClientCommand(edict_t *pEntity)
{
const char *pcmd = eng->Cmd_Argv(0);
Msg("myadmin::ClientCommand() got command %s\n",pcmd);
if ( !pEntity || pEntity->IsFree() )
{
return PLUGIN_CONTINUE;
}
if ( FStrEq( pcmd, "n_listadmins" ) )
{
if (g_accUsed == 0) {
eng->ClientPrintf(pEntity,"No admins loaded");
}
for (int i=0;i<g_accUsed;i++) {
char temp[512];
sprintf(temp,"%s /t %s",acc[i].steamid,acc[i].access);
eng->ClientPrintf(pEntity,temp);
}
return PLUGIN_STOP;
}
return PLUGIN_CONTINUE;
}
I have that stuff. But it wont catch an of the commands, I don't even get a myadmin::ClientCommand() got command %s\n