PDA

View Full Version : CodeCallback_PlayerCommand(args) not working



Ni3ls
22nd January 2017, 11:32
Hi all,

Im using Voron's libcod version on COD2 1.3. Everything is working (mysql etc), however the playercommand function isnt.
It doesnt iprint the input and looks like the function is not called. Am I missing something or is it not suitable for 1.3?

CodeCallback_PlayerCommand(args)
{
if (isDefined(args[0]))
{
command = "";
for (i = 0; i < args.size; i++)
command = command + args[i] + " ";

iprintln(command);
}
}

IzNoGoD
22nd January 2017, 12:02
Youll need to full-restart your cod2 server as libcod looks for that function during startup. Adding it in later won't work, as a map_restart does NOT trigger libcod to look for said function again.

Also, assuming that you're using a mod, make sure that 1) this code is inside maps/mp/gametypes/_callbacksetup.gsc and 2) that said file is not inside any of your modded .iwd files.

Ni3ls
22nd January 2017, 12:44
Youll need to full-restart your cod2 server as libcod looks for that function during startup. Adding it in later won't work, as a map_restart does NOT trigger libcod to look for said function again.


This was the problem. Thanks!