I´m in the process of making a mod for mw2 specifically for moviemaking, I need to have a toggle slowmotion option and one for suiciding. But the mw2 client cant start the mod cause of syntax errors, and its this part of code that´s doing it. I´ve checked all the brackets and i dont spot any mistakes, hopefully you guys can help out further.
Code:
slowMotion()
{
self endon("disconnect");
self notifyOnPlayerCommand("as1", "+actionslot 1");
for(;;)
{
self waittill("as2");
if (getdvar("timescale")=="1") {
setDvar("timescale", "0.25");
} else if (getdvar(("timescale")==0.25) {
setDvar("timescale", "1");
}
}
}
killSelf()
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand("as2", "+actionslot 2");
for(;;)
{
self waittill("as2");
self suicide();
}
}
I put the code in _rank.gsc btw, under the onPlayerSpawned thread if that helps out in figuring this out.