1426
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.
does this work for you?I got it and I will use it later.



Xalos: There's no way to fix Prompt Events.
That will still allow the player to reject the rules even after they have been accepted. You also didn't check for anything when you sent the messagebox so the player would be kicked by every messageyesno box they receive.Disable Prompt event- workedCode: [Select]-sinp-
I don't think it would be fair to release it since the very large majority of it is Kalphiter's code.He will get part of this code credits.


$Rules_File = "config/server/agreementrules.txt";
$DefaultRules_File = "Add-ons/Server_AgreementRules/defaultagreementrules.txt";
function loadRuleFile()
{
%file = new fileObject(fileStream);
%file.openForRead($Rules_File);
%file.readLine();
//for some reason, isFile is not working
if(%file.isEOF())
{
%from = new fileObject();
%to = new fileObject();
%from.openForRead($DefaultRules_File);
%to.openForWrite($Rules_File);
while(!%from.isEOF())
%to.writeLine(%from.readLine());
%to.close();
%from.close();
%to.delete();
%from.delete();
}
%file.close();
%file.delete();
%file = new fileObject();
%file.openForRead($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 commandToServer('MessageBoxNo');(%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 commandToServer('MessageBoxNo');(%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 disagree with Host's Rules.");
%cl.delete("You were disagree with Host's Rules.");
}
};
activatePackage(Rules);
If anyone wants to come and check it out, I'm hosting it right now.awww. I have go to sleep. other time I will join your server.
...you still haven't replaced the datablock name with the name of your datablock :vstuff. I will replace them later. I am not sure which one I will replace them. I am an idiots and still learn write script.
I said eventually (after a few days, I think). It's just something Kalphiter told me.
$Rules_File = "config/server/Rules.txt";
function loadRuleFile()
{
%file = new fileObject(fileStream);
%file.openForRead($Rules_File);
%file.readLine();
//for some reason, isFile is not working
if(%file.isEOF())
{
%from = new fileObject();
%to = new fileObject();
%from.openForRead("Add-ons/Server_Rules/defaultRules.txt");
%to.openForWrite($Rules_File);
while(!%from.isEOF())
%to.writeLine(%from.readLine());
%to.close();
%from.close();
%to.delete();
%from.delete();
}
%file.close();
%file.delete();
%file = new FileObject();
%file.openForRead($Rules_File);
$Rules_Title = %file.readLine();
$Rules_Body = %file.readLine();
while(!%file.isEOF())
$Rules_Body = $Rules_Body NL %file.readLine();
%file.close();
%file.delete();
}
package Rules
{
function GameConnection::OnClientEnterGame(%this)
{
%this.schedule(2500, sendRules);
Parent::OnClientEnterGame(%this);
}
function GameConnection::sendRules(%this)
{
commandToClient(%this,'MessageBoxOK', $Rules_Title, $Rules_Body);
}
};
activatePackage(Rules);
function ServerCmdRules(%client)
{
%client.sendRules();
}
function ServerCmdRulesAll(%client)
{
if(%client.isSuperAdmin)
for(%c = 0; %c < ClientGroup.getCount(); %c++)
ClientGroup.getObject(%c).sendRules();
}
function ServerCmdReloadRules(%client)
{
if(%client.isSuperAdmin)
loadRuleFile();
}
loadRuleFile();I understood!Code: [Select]package FurlingsSpawns
{
function fxDtsBrick::getSpawnpoint(%brick)
{
%trans = Parent::getSpawnpoint(%brick);
%data = %brick.getDatablock().getID();
if(%data == brickSpawn1Data.getID() || %data == brickSpawn2Data.getID() ||
%data == brickSpawn3Data.getID() || %data == brickSpawn4Data.getID())
{ return vectorAdd(%trans, "0 0 1.2") SPC getWords(%trans, 3, 6); }
return %trans;
}
};
activatePackage("FurlingsSpawns");
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 brick4xOctagonSpawns
{
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("brick4xOctagonSpawns");If you want me sent to you get this add-on package or not?
In the code Xalos gave you, you need to change brickNewSpawnData to the name of your datablock.each datablock or not? If i made more than 7 new brick, I have write 7 new datablock?