Show Posts

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.


Messages - Furling²

Pages: 1 ... 91 92 93 94 95 [96] 97 98 99 100 101 ... 121
1428
Add-Ons / Agreement Rules
« on: June 25, 2013, 01:34:53 PM »


Installation
Put Server_AgreementRules.zip into the Add-Ons folder in your Blockland folder.


What is Agreement Rules?
Any player must agree with Host's Rules allow join the server, If disagree then the player will kick out of the server.

Can i change the rules in the notepad?
config/server/agreementrules.txt (Edit on the notepad)

Can I change the rule in the script?
You can edit the script.

NOTE: Disable Prompt Event or it will not work.
Quote
Xalos: There's no way to fix Prompt Events.

I did tested on this below list before I release this mod.
1.Solo Server-worked
2.Internet Server-worked
3.Dedicated Server-worked
Disable Prompt event- worked
Enable Prompt event- not work (NO button)

Credits:
Furling- Lead on this project/code/beta tester
Kalphiter- original code (file load notepad)
Danny Boy- fix code/beta tester
Pacnet2013- help code/beta tester
Xalos- help and fix code/beta tester

Change Verison
V1 to V2 - correct grammar.

1429
Modification Help / Re: Endless Mining the 2nd - Let's try this again
« on: June 25, 2013, 01:06:37 PM »
where the download? I did click the link took me to your website. nothing there.

1430
Modification Help / Re: My Script ( agreement rules)
« on: June 25, 2013, 11:07:21 AM »
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.

Code: [Select]
-sinp- 

Disable Prompt event- worked
Enable Prompt event- not work (NO button)

1431
Modification Help / Re: My Script ( agreement rules)
« on: June 25, 2013, 10:21:46 AM »
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.

I test this has a few isussed:
1.Solo Server-worked
2.Internet Server-worked
3.Dedicated server-worked
Disable Prompt event- worked
Enable Prompt event- not work (NO)


1432
Modification Help / Re: My Script ( agreement rules)
« on: June 25, 2013, 09:19:40 AM »
I did tested on Ded server does not work only yes, not "NO" work. how I can remove cmd NON-abused?
CmdMessageBoxNo
CmdMessageBoxYes
these are cmd.
But Solo server work. I agree with xalos that cmd are abused, how I can fix on non-abuse?

EDIT fix code:
Code: [Select]
$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);

1433
Modification Help / Re: My Script ( agreement rules)
« on: June 25, 2013, 08:22:16 AM »
Thank you guys for help me out for fix this and I will make sure you get part of credits for hard work on the code.

1434
Modification Help / Re: Endless Mining the 2nd - Let's try this again
« on: June 25, 2013, 12:58:27 AM »
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.

1435
Modification Help / Re: Brick Spawn Script
« on: June 25, 2013, 12:56:17 AM »
...you still haven't replaced the datablock name with the name of your datablock :v
stuff. I will replace them later. I am not sure which one I will replace them. I am an idiots and still learn write script.

1436
Modification Help / Re: My Script ( agreement rules)
« on: June 25, 2013, 12:46:14 AM »
I said eventually (after a few days, I think). It's just something Kalphiter told me.

Kalphiter wrote his code:

Code: [Select]
$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();

That function loadRuleFile() are work, how come my code does not work... but Kalphiter's code pretty worked.

1437
Modification Help / Re: RTBGS Invite Failed Message
« on: June 25, 2013, 12:35:29 AM »
Don't give up on your project!

1438
Modification Help / Re: Brick Spawn Script
« on: June 25, 2013, 12:32:25 AM »
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");
I understood!

EDIT: I was test again.. same result.

Code: [Select]
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?

1439
Modification Help / Re: Brick Spawn Script
« on: June 25, 2013, 12:28:09 AM »
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?
http://forum.blockland.us/index.php?topic=235110.0 more details.

1440
Modification Help / remove this topic.
« on: June 25, 2013, 12:20:48 AM »
forget wrong topic!

Pages: 1 ... 91 92 93 94 95 [96] 97 98 99 100 101 ... 121