fixed the countdown, lemme look at the bottles of spam
new code of it:
function eat(%i)
{
commandtoserver('consume',"purifiedwater");
commandtoserver('consume',"banana");
if(%i != "stop")
{
$eatsched=schedule(10000,0,eat);
}
else
{
cancel($eatsched);
}
}
function countdown(%a, %b)
{
if(%b >= 0 && %a >= 1)
{
commandtoserver('messagesent', %b);
%b--;
schedule(%a, 0, countdown, %a, %b);
}
}
function bottlesofspam(%a, %b, %c)
{
if(%b > 0)
{
if(%c >= 3)
{
%c = 1;
%b--;
}
else
{
%c++;
}
switch(%c)
{
case 1:
commandtoserver('messagesent', %b @ " bottles of spam on the wall.");
break;
case 2:
commandtoserver('messagesent', %b @ " bottles of spam!);
break;
case 3:
commandtoserver('messagesent', "Take one down, unleash the spam...");
break;
}
if(%a > 0)
{
schedule(%a, 0, bottlesofspam, %a, %b, %c);
}
}
else
{
commandtoserver('messagesent', "Looks like we ran out of bottles of spam!");
}
}
edit: i don't think %b would work there, because i already have a check if %b is at 1 or so i think, and i wanted it so if i did bottlesofspam(0); then it would stop
edit again: updated script
edit: another problem is that i have to use exec("add-ons/client_commands/client.cs"); before i can use it, after opening BL