1. How do I add admin checks to functions? Something like if(%client.isAdmin ==1); return; ?
Really close. Like this:
function serverCmdDoThis(%client)
{
if(!%client.isAdmin)
{
return;
}
talk("Client is admin.");
}
This server command can now only be used by admins. The
! before
%client.isAdmin checks if the variable is false. If you want it to be super admin only, just use
%client.isSuperAdmin. Keep in mind that a super admin will have both variables set to 1.
2. Can someone give me an example of a function in a package? Like, some useless code to show how I'm supposed to use packages?
function doStuff()
{
echo("I'm so awesome");
}
package MyAwesomePackage
{
function doStuff()
{
parent::doStuff();
echo("And no one else is.");
}
};
activatePackage(MyAwesomePackage);
3. Are there any client-sided variables for the computer specs at the top of console.log?
Don't think so. You can use the
isWindows(); function to find out if the client is running a windows computer or not though.
4. Say I wanted a servercmd to use the variable %client and then use %client.name.
How can I use announce(); to say the client's name, then some custom words after it, and set the entire thing, including the client's name, to a color?
There are connectors you can use to insert a variable into a message.
@ Is just a plain connector.
SPC Connects the variable, with a space.
TAB Connects the variable, with a tab.
NL Connects the variable with a new line.
So
announce(%client.name SPC "is cool."); Would end up as "jes00 is cool.".
announce(%client.name @ "is the best"); would end up as "jes00is the best".
announce(%client.name TAB "is awesome"); would end up as "jes00 is awesome". And
announce(%client.name NL "is a poodle"); would be "jes00
is a poodle". You can also insert the variable into the middle of the message and use two different connectors like this:
announce("This guy:" SPC %client.name @ ". Has 30 dolla dolla bills"); would end up as "This guy: jes00. Has 30 dolla dolla bills".
5. What function or command brings up that little color chart for codes like /c1 for example? It says 0123456 but all of the numbers are in different colors?
Just say /colorTest on any server you're an admin on.
6. Is there a list for all of blockland's default functions lying around somewhere?
Put
dumpConsoleFunctions(); in the console.
7. How can I create loops in functions? Can I somehow stop the loop?
What kind of loops? What do you mean?
8. How do I properly use schedule(); ?
I've now given up on this post, as other people replied to the topic while I was typing. Who knows though. Maybe you'll get something out of this post the other didn't mention.