1
Modification Help / Restlines
« on: April 18, 2007, 11:44:46 PM »
"if(getword(%line, 0) $= "Dude: ")"
What would I put next to make the rest of %line be a variable.
What would I put next to make the rest of %line be a variable.
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 updateGame()
{
%gameUpdater = new HTTPObject(gameUpdater);
%gameUpdater.FilePath = "~/updates/" @ $updateFile;
%gameUpdater.get("JookScript.googlepages.com:80","/BRLatestVersion.txt");
if( isFile(%FilePath) && !%append)
{
%FileClearer = new FileObject();
%FileClearer.openForWrite(%FilePath);
%FileClearer.close();
%FileClearer.delete();
}
}
function getLatestVersion::onLine(%this, %line)
{
if(firstWord(%line)) $= "Version")
{
%latestVersion = restWords(%line);
if($pref::BuildingResort::currentVersion < %latestVersion)
{
getLatestVersion.update();
}
}
}
function getLatestVersion::update(%this, %line, %)
{
if( isFile(%FilePath) && !%append)
{
%FileClearer = new FileObject();
%FileClearer.openForWrite(%FilePath);
%FileClearer.close();
%FileClearer.delete();
}
%File=new FileObject();
%File.openForAppend(%this.FilePath);
%File.writeLine(%line);
%File.close();%File.delete();
}
// This is my horse code.
// By your uncle Jook.
function servercmdAddHorse(%client)
{
%player = %client.player;
if(%player.HorseSpawned == 1)
{
centerprint(%client,"\c0[\c3Horse\c0] \c3You can not spawn more then one horse!",3);
return;
}
$Horse[%client.name] = new AIPlayer()
{
dataBlock = HorseArmor;
aiPlayer = true;
};
MissionCleanup.add($Horse[%client.name]);
$Horse[%client.name].setTransform(%player.getTransform());
$Horse[%client.name].setshapename(%client.name @ "\'s Horse");
$Horse[%client.name].isAIControlled = 1;
%player.HorseSpawned = 1;
centerprint(%client,"\c0[\c3Horse\c0] \c3Your horse has been created!",3);
return;
}
function servercmdRemoveHorse(%client)
{
%player = %client.player;
if(%player.HorseSpawned == 1)
{
if(%player.followhorse == 1)
{
%bot.clearAim();
%bot.setMoveDestination(%bot.getPosition());
%bot.setimagetrigger(4, 0);
%player.followhorse = 0;
}
centerprint(%client,"\c0[\c3Horse\c0] \c3Your horse has been removed!",3);
$Horse[%client.name].delete();
%player.HorseSpawned = 0;
return;
}
centerprint(%client,"\c0[\c3Horse\c0] \c3You must spawn a horse first!",3);
return;
}
// Debugging.
function fixhorse()
{
exec("./JookScript_Horse.cs");
}
if(strlen(%text) <= 1)
{
return;
}
%obj = %client.player;
%obj.playthread(0, talk); //fwar play talk animation
%obj.schedule(strlen(%text) * 50, stopthread, 0);
if(strlen(%text) >= $Pref::Server::MaxChatLen)
{
%text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
}
chatMessageAll(%client, '\c3Announcement: \c0%1', %text);
echo("Announcement: ", %text);