Author Topic: Preferences References (RTB)  (Read 1545 times)

I would like to make a pref for my Kill mod and other Server commands that I make so that the Host can control who can use it (Admins, Super Admin, Host, All) and I have looked at the RTB brief tutorial. I want to make check boxes if I could. Ill look at the RTB system server or something. But if anyone could do a more detailed tutorial on making preferences, please do so. Thanks!


While fanning through the RTB system servercommand file, I found three different types of preferences:

Bool (a checkbox)

int (number from min to max)

list (exactly how it sounds)

Now I have figured out that  for this specific preference, I would want a list. But I dont know how to name the things in the list here is what I'm doing:

Code: [Select]
if(isFile("Add-Ons/System_ReturnToBlockland/server.cs"))
{
if(!$RTB::RTBR_ServerControl_Hook)

exec("Add-Ons/System_ReturnToBlockland/RTBR_ServerControl_Hook.cs");
RTB_registerPref("Kill Command","Server Commands","Kill::Users","list SuperAdmin Host Admins All", "Kill Command","SuperAdmin", 0, 1);
}
else
{
$Kill::Users = SuperAdmin;
}

Now when I do that, the list comes out as SuperAdmin and Host, nothing else, and the default isn't SuperAdmin, it's nothing. Could someone please help me with this preference?

Lists must be of the form "list Name1 Return1 Name2 Return2 ..."

For instance, yours should be: "list Host 0 SuperAdmin 1 Admin 2 All 3" and then the default should be 1. You'd have to change your script to check for $Kill::Users = 0, 1, 2, 3 rather than "SuperAdmin" or "Admin".

Space, could you go more in depth now that I have that down, could you tell me how to make the buttons operate?