PDA

View Full Version : fixChatArgs(args)



IzNoGoD
7th January 2016, 19:40
Made a small update to libcod so fixChatArgs() is no longer required.

Whoever knows how to use git: feel free to push this



stackPushArray();
int args = trap_Argc();
for (int i=0; i<args; i++)
{
char tmp[1024];
trap_Argv(i, tmp, sizeof(tmp));
if(i == 1 && tmp[0] >= 20 && tmp[0] <= 22)
{
char *part = strtok(tmp + 1, " ");
while(part != NULL)
{
stackPushString(part);
stackPushArrayLast();
part = strtok(NULL, " ");
}
}
else
{
stackPushString(tmp);
stackPushArrayLast();
}
}


in libcod.cpp, hook_clientCommand

maxdamage99
7th January 2016, 20:52
Your github: https://github.com/iznogod/libcod ??

IzNoGoD
7th January 2016, 21:25
didnt know i had one lol