Sorry, was trying to reply yesterday but forgot my password, then forgot my Google mail password and only just got a chance to reset it!
The issue is a curious one, I'm not complete sure myself. I have altered it so that CommandUserIndex is automatically +1 when it's set (As it comes in -1 of the index) However, the command index I had to parse to the function needed to be a +1 of that again, which doesn't quite make sense to me, allow me to explain:
Here's the code now:
Code:
serverplugin_main::
void CMatchAdmin::SetCommandClient( int index )
{
m_iClientCommandIndex = index;
Command.ClientCommand(index + 1);
}
Commands.h::
void pma_test(const CCommand &args)
{
//DumpServerClasses();
edict_t *pEntity = pEngine->PEntityOfEntIndex( (Command.GetCommandIndex() + 1) );
if ( !pEntity || pEntity->IsFree() ) return;
char result[64];
if (getClanTag(pEntity,result,64))
{
Msg("Result: %s\n",result);
}
else
{
Msg("Failed\n");
}
}
ConCommand pa_test("pa_test", pma_test, "PMA ~ Test Command", 0);
As you can see I already add 1 when setting it in the commands function, so I'm not quite sure why it required an addition +1, maybe you guys know why?
Also INetChannel and IClient required the +1 as well, which again makes me a little confused
As for finding, My first through is to just extract portions of the pEntity and do a strstr check until I find it, but I did find it crashed at about Offset 3000-3100, but it was alright for the rest of it. saying that, Sourcemods way sounds a lot easier and cleaner!
Now I've just got to fix that issue I made a post about before (Displaying a local html file in the vgui window) and my plugin is completed :O
Thanks for all the help
- Edd