16
Gallery / wtf am I doing
« on: August 14, 2014, 05:14:58 PM »
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
function TC_lovetract(%msg, %phrase)
{
%dp = strpos(%phrase, "-");
%lw = getSubStr(%phrase, (%dp + 1), 1);
%fw = getSubStr(%phrase, 0, (%dp - 1));
%wc = getWordCount(%msg);
for(%a=0;%a<%wc;%a++)
{
if(getWord(%msg, %a) $= %fw)
%fwl = %a;
else if(getWord(%msg, %a) $= %lw)
%lwl = %a;
if(%a >= 30)
return error("Stopping endless loop!");
}
return getWords(%msg, 0, (%fwl - 1)) SPC getWords(%msg, (%lwl + 1), %wc);
}
If you don't mind, please tell me what I did wrong.



stateName[0] = "Activate";
stateTimeoutValue[0] = 0.15;
stateTransitionOnTimeout[0] = "Ready";
//stateSound[0] = "";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1]= "Fire";
stateAllowImageChange[1] = true;
stateEmitter[1] = WoodenStaffEmitter;
stateEmitterTime[1] = 300;
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Reload";
stateTimeoutValue[2] = 1.80;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
//stateSound[2] = "";
stateName[3] = "Reload";
stateTransitionOnTriggerUp[3] = "Ready";
function servercmdHELP()
{
}
Where as now, each player on that specific server can now type /HELP . And it will call whatever is in those brackets. Unfortunately when you join another server, and type /HELP that same command won't work. Which is why a server command, is a server command.function clientcmdMEOW() //Only use "clientcmd" prefix when you are communicating with the server..
{
}
What is different about a Client command, is that your own computer possesses the command. So you can join any server, and it will work.function servercmdUPDATECAKES(%client,%cakes)
{
$CakeAmount = %cakes;
}
function SendCakes()
{
%cakes = 4;
CommandtoServer('UPDATECAKES',%cakes);
}
function servercmdSENDGRAMS(%client, %grams, %person)
{
%target = findclientbyname(%person);
CommandtoClient(%target,'RECEIVEGRAMS',%grams);
}
function clientcmdRECEIVEGRAMS(%grams)
{
$CurrentGrams = %grams;
}
%heroname = getword(%fo.line1,1);
$HeroAttack.Hero_[%heroname]_Occupied ##=## false;
$HeroAttack.Hero_[%heroname]_Job = getword(%fo.line2,1);