Author Topic: Random piece of code in GM zombie?  (Read 492 times)

I was looking in the script for Rotondo's Zombie mod and came across this:

Code: [Select]
if(%targ.getclassname() $= "Player" && isInMinigame(%targ) && isInSameMinigame(%player,%targ) && %player.spawnbrick.getgroup().client.tdmTeam == %targ.client.tdmTeam)
{
%player.setmoveobject(%targ);
return 1;
}
}
return 0;
}
function servercmdcast(%client,%sand){
if(%sand $= "sandwich" || %sand $= "sandvich")
{
Messageclient(%client,'0',"You cast a sandwich...");
%client.player.mountimage(sandwichimage,0);
%client.player.playthread(2,armreadyright);

if(%client.name $= "Badspot")
{
schedule(2000,0,messageclient,%client,'0',"...but Badspot... wait wtf?");
return;
}

%client.player.schedule(2000,playthread,2,root);
%client.player.schedule(2000,unmountimage,0);
schedule(2000,0,messageclient,%client,'0',"...but Badspot takes it before you eat it.");
return;
}
if(%sand $= "fireball"){
Messageclient(%client,'0',"You cast a fireball, but then you realize this isn't Age of Time.");
return;
}
if(%sand $= "Badspot")
{
Messageclient(%client,'0',"You have casted poorly.");
schedule(10000,0,Messageclient,%client,'0',"<color:0000EE>Badspot connected.");
schedule(14000,0,Messageclient,%client,'0',"<color:FFFF00>Badspot<color:FFFFFF>: hey");
schedule(20000,0,Messageclient,%client,'0',"<color:0000EE>Badspot spawned.");
return;
}
if(%sand $= "")
{
Messageclient(%client,'0',"You cast nothing.");
schedule(2000,0,Messageclient,%client,'0',"Nothing happened.");
return;
}
Messageclient(%client,'0',"You have casted poorly.");

What exactly does this mean?

rotondo was loving around and put in random code snippets that there might be a one in a million chance of someone happening upon. happens a lot with the older, more experienced coders.

Heh, that's kinda cool. Thanks.