Blockland Files > Add-Ons
Advanced Rules
Nero Mich:
--- Quote from: General Omega on August 14, 2008, 03:39:26 PM ---He had trouble with the GUI. He thought that GUI's are downloaded in V9. Instead I and Nix suggested the MessageboxOK since it is a universal GUI.
--- End quote ---
Yup.
Dyed Brownie:
Of course, apart from that fact that you could've put it in the console for the client, where they could use the scrollbar, and not risk rules getting cut off in message boxes, the message box is OK.
Nero Mich:
--- Quote from: Dyed Brownie on August 14, 2008, 03:45:15 PM ---Of course, apart from that fact that you could've put it in the console for the client, where they could use the scrollbar, and not risk rules getting cut off in message boxes, the message box is OK.
--- End quote ---
But then they do not see it when they spawn. Its a fact of noobs being lazy.
This forces them to at the lest to see the rules.
Amiret:
I see. Also:
--- Code: ---$Rules::File="Add-Ons/Script_GRules/Rules.txt"; //File path for loading
function LoadRules(%f)
{
%FO=new FileObject(); //FileObject, so you can read it
%FO.openForRead(%f);
$Rules::Title=%FO.readLine(); //Read the first line for the title
$Rules::Text=%FO.readLine(); //Read the next for the rules
while(!%fo.isEOF())
{
$Rules::Text=$Rules::Text NL %FO.readLine(); //For more rules, until you reach the end of the file
}
%FO.close(); //Close, then delete the fileObject.
%FO.delete();
}
LoadRules($Rules::File); //Actually load the rules
package Rules_Server
{
function gameconnection::OnClientEnterGame(%this,%a,%b,%c,%d,%e) //When they enter, the gui pops up.
{
schedule(1000,0,commandToClient,%this,'MessageBoxOK',$Rules::Title,$Rules::Text);
Parent::OnClientEnterGame(%this,%a,%b,%c,%d,%e);
}
};
Activatepackage(Rules_Server);
function ServerCmdRules(%client,%a,%b,%c,%d,%e) //Send them the rules if they want to see it, what the hell is with the %a,%b,%c, etc ?
{
commandToClient(%client,'MessageBoxOK',$Rules::Title,$Rules::Text);
}
function ServerCmdRulesAll(%client,%a,%b,%c,%d,%e) //Sends the rulees to everyone
{
if(%client.isSuperAdmin) //check for supr admin
{
commandToAll('MessageBoxOK',$Rules::Title,$Rules::Text); //send the command to all bringing up the rules
}
else
{
messageclient(%client,"","\c0You are not Super admin. Please type \c3/rules \c0for the server rules."); //If their not, show this message.
}
}
--- End code ---
I can read code damn well.
Also, sorry about that needing help from nix. but still, its not very amazing.
Nero Mich:
--- Quote from: Amiret on August 14, 2008, 03:50:50 PM ---I see. Also:
I can read code damn well.
Also, sorry about that needing help from nix. but still, its not very amazing.
--- End quote ---
....Lets see if anyone else has done something like this
hmm nope...