1441
Off Topic / Re: so today i mowed the lawn
« on: June 25, 2013, 12:16:34 AM »
I want pay to you can mow over my hair need cut.
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.
Sorry, this is unrelated to your question. You need to change this:I did tested it has not crashed. I keep same old code. once I release it, so you can edit it, if you like to.Code: [Select]to this:Parent::OnClientEnterGame(%this);Code: [Select]or apparently the server will eventually crash.return parent::OnClientEnterGame(%this);
Code: [Select]package NewSpawn
{
function fxDtsBrick::getSpawnpoint(%brick)
{
%trans = Parent::getSpawnpoint(%brick);
if(%brick.getDatablock().getID() == brickNewSpawnData.getID())
{ return vectorAdd(%trans, "0 0 1.2") SPC getWords(%trans, 3, 6); }
else return %trans;
}
};
activatePackage("NewSpawn");
That should work.
datablock fxDTSBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";
specialBrickType = "Brick Spawn";
orientationFix = 1;
canCover = false;
category = "Special";
subCategory = "Revloution Spawn";
uiName = "4 x Octagon";
iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";
indestructable = true;
};
function brick4xOctagonSpawnData::onPlant(%data, %brick)
{
brickSpawnpointData::onPlant(%data, %brick);
}
function brick4xOctagonSpawnData::onLoadPlant(%data, %brick)
{
brickSpawnpointData::onLoadPlant(%data, %brick);
}
package NewSpawn
{
function fxDtsBrick::getSpawnpoint(%brick)
{
%trans = Parent::getSpawnpoint(%brick);
if(%brick.getDatablock().getID() == brickNewSpawnData.getID())
{ return vectorAdd(%trans, "0 0 1.2") SPC getWords(%trans, 3, 6); }
else return %trans;
}
};
activatePackage("NewSpawn");I was considering this, but it would cause a massive framerate drop.look at [GSF]Ghost's PTP has prints script.
$Rules_Title = %file.readLine();Where I put them in the line?
$Rules_Body = %file.readLine();
You have this, which reads the same line, I think.
Also, make a text file for both of them.
The default has to exist.
Global variables is a server variable that never goes away unless the server ends, RTB prefs use global variables, and so does the server.Little understand, anyway I really want finish on this script for text put in title and body.
Global variables use $ and they do not have to be in functions.
Example: $Pref::Server::MaxPlayers = "32"; this would set the max players of your server to 32. When using global variables they can do anything in use.
So like as your script:
$Rules_Title, $Rules_Body <-- These are global variables. But they have to be set though, I will make a script that shows as server-sided.Code: [Select]$CanHaveNachos = true; //Resulted as 1
function serverCmdTacos(%c)
{
if($CanHaveNachos) //Checks if it is enabled
{
messageClient(%c,'',"No you cannot.");
return;
}
messageClient(%c,'',"Here are your nachos.");
}
Do the global variables exist? ($Rules_Title and $Rules_Body)I not know what this mean? please explain to me.
You didn't define $Rules_Body before you tried to trim it and get the next line. Also when sending a 'messageBoxYesNo' to a client one of the arguments is the yes command which you need to include. If the client clicks no then MessageBoxNo will be called. It's kinda awkward but it's just the way it is.Thank you that message in chat box are worked! Last thing the problem issued are pop up box are blank.
Try this:Code: [Select]$Rules_File = "config/server/agreementrules.txt";
$DefaultRules_File = "Add-ons/Server_AgreementRules/defaultagreementrules.txt";
function loadRuleFile()
{
if(!isFile($Rules_File)) //If it doesn't find the rules file...
fileCopy($DefaultRules_File, $Rules_File); //Copy the one we have.
%file = new FileObject(); //Create the object to read/write files.
%file.openForRead($Rules_File); //Open the rules file.
$Rules_Title = %file.readLine(); //The first line of the file is the title.
$Rules_Body = %file.readLine(); //Define $Rules_Body
while(!%file.isEOF()) //Keep reading lines until we reach the end of the file.
$Rules_Body = trim($Rules_Body NL %file.readLine()); //Add the next line to the rules body. Doing the trim function removes things like spaces and tabs that we don't want.
%file.close(); //Close the file; important.
%file.delete(); //Delete the file object.
}
loadRuleFile();
package Rules //we want to make a package
{
function GameConnection::OnClientEnterGame(%this)
{
%this.schedule(2500, sendRules);
Parent::OnClientEnterGame(%this);
}
function GameConnection::sendRules(%this)
{
commandToClient(%this,'messageBoxYesNo', $Rules_Title, $Rules_Body,'AcceptRules'); //Send the messagebox properly
}
function serverCmdAcceptRules(%cl) //Unsure if this is works, but I think it should. Supposedly this is done when they press yes.
{
messageAll('',"\c3" @ %cl.getPlayerName() @ "\c2(ID:" SPC %cl.getBLID() @ ") \c6agreed with Host's Rules.");
}
function serverCmdMessageBoxNo(%cl) //This is the serverCmd that is done when they press no. (hopefully)
{
messageAll('',"\c3Host \c2kicked \c3" @ %cl.getPlayerName() @ "\c2(ID:" SPC %cl.getBLID() @ ") \c6for not agree with Host's Rules.");
%cl.delete("You were not agree with Host's Rules.");
}
};
activatePackage(Rules);
That should work. Try it.YES! It does work! when I press Ctrl and K to die after I did spawned was under the brick spawn and drop long way down, how I can adjust position put player top at the brick spawn?
$Rules_File = "config/server/agreementrules.txt";
$DefaultRules_File = "Add-ons/Server_AgreementRules/defaultagreementrules.txt";
function loadRuleFile()
{
if(!isFile($Rules_File)) //If it doesn't find the rules file...
fileCopy($DefaultRules_File, $Rules_File); //Copy the one we have.
%file = new FileObject(); //Create the object to read/write files.
%file.openForRead($Rules_File); //Open the rules file.
$Rules_Title = %file.readLine(); //The first line of the file is the title.
while(!%file.isEOF()) //Keep reading lines until we reach the end of the file.
$Rules_Body = trim($Rules_Body NL %file.readLine()); //Add the next line to the rules body. Doing the trim function removes things like spaces and tabs that we don't want.
%file.close(); //Close the file; important.
%file.delete(); //Delete the file object.
}
loadRuleFile();
package Rules //we want to make a package
{
function GameConnection::OnClientEnterGame(%this)
{
%this.schedule(2500, sendRules);
Parent::OnClientEnterGame(%this);
}
function GameConnection::sendRules(%this)
{
commandToClient(%this,'messageBoxYesNo', $Rules_Title, $Rules_Body);
}
function serverCmdMessageBoxAccept(%cl) //Unsure if this is works, but I think it should. Supposedly this is done when they press yes.
{
messageAll('',"\c3" @ %cl.getPlayerName() @ "\c2(ID:" SPC %cl.getBLID() @ ") \c6agreed with Host's Rules.");
}
function serverCmdMessageBoxNo(%cl) //This is the serverCmd that is done when they press no. (hopefully)
{
messageAll('',"\c3Host \c2kicked \c3" @ %cl.getPlayerName() @ "\c2(ID:" SPC %cl.getBLID() @ ") \c6for not agree with Host's Rules.");
%cl.delete("You were not agree with Host's Rules.");
}
};
activatePackage(Rules); //activate package after the package is createdYes and No button are worked.
...Guys, spawnpoints are just bricks. The only thing that makes them spawn players is the code in their onPlant and onLoadPlant functions. You're going to have to call that if you want new spawnpoint bricks to work robustly.I have add these lines something like this?Code: [Select]function brickNewSpawnData::onPlant(%data, %brick)
{
brickSpawnpointData::onPlant(%data, %brick);
}
function brickNewSpawnData::onLoadPlant(%data, %brick)
{
brickSpawnpointData::onLoadPlant(%data, %brick);
}
datablock fxDTSBrickData (brick4xOctagonSpawnData : brickSpawnPointData)
{
brickFile = "Add-Ons/Brick_Revloution_Spawn/4xOctagonSpawn.blb";
specialBrickType = "Brick Spawn";
orientationFix = 1;
canCover = false;
category = "Special";
subCategory = "Revloution Spawn";
uiName = "4 x Octagon";
iconName = "Add-Ons/Brick_Revloution_Spawn/4xOctagon";
indestructable = true;
};
function brick4xOctagonSpawnData::onPlant(%data, %brick)
{
brickSpawnpointData::onPlant(%data, %brick);
}
function brick4xOctagonSpawnData::onLoadPlant(%data, %brick)
{
brickSpawnpointData::onLoadPlant(%data, %brick);
}I am correct or wrong?
My suggestion is much better. Make rental/sub-lots so you can build an apartment building and then lease out or sell apartments.This.