void __stdcall command_test(vector params)
{
cout << "Test just executed\n";
}
void __stdcall command_repeat(vector params)
{
if (params[0].type != PARAM_UL)
{
cout << "Bad format buddy\n";
return;
}
if (params.size() < 2)
{
cout << "Uuh, what do you want to repeat?\n";
return;
}
unsigned long count = params[0].l;
for (unsigned long i = 0; i < count; i++)
ExecuteCommand(params[1].sp);
}
void CommandLineTest()
{
commandlist["help"] = command_help;
commandlist["test"] = command_test;
commandlist["repeat"] = command_repeat;
ExecuteCommand("repeat 4 repeat 2 test");
}