Skip to content

System API

MasterGeneral156 edited this page Apr 6, 2017 · 12 revisions

The System API

The User API is useful when you need to interact with users directly.

Available Functions

SystemReturnAPIVersion();
SystemFilterInput();
SystemLogsAdd();
SystemUserIDtoName();
SystemUsernametoID();
SystemItemIDtoName();
SystemItemNametoID();
SystemTownIDtoName();
SystemReturnTax();
SystemReturnTaxOnly();
SystemCreditTax();

SystemReturnAPIVersion();

SystemReturnAPIVersion(); is a function used to return the current API version. This function takes no variables.
$api->SystemReturnAPIVersion();

This function returns the API version.

SystemFilterInput();

SystemFilterInput(); is a function used to return filtered input. This function takes 2 variables. This function may or may not be safe.
$api->SystemFilterInput($var1,$var2);
Variable #1 - Text. What the input is to be filtered. Accepts int, float, text, url and email.
Variable #2 - Input. Input to filtered according to variable #1.

This function returns filtered input.

SystemLogsAdd();

SystemLogsAdd(); is a function used enter an entry into the main logs data table. This function accepts three variables.
$api->SystemLogsAdd($var1,$var2,$var3);
Variable #1 - Int. The User's ID who's attached to this log entry.
Variable #2 - Text. Log type. See staff panel's log page to see standardized names.
Variable #2 - Text. Log text. Informational text explaining log. (Ate an apple)

This function returns nothing.

SystemUserIDtoName();

SystemUserIDtoName(); is a function used to fetch a username from the specified user id. This function accepts one variable.
$api->SystemUserIDtoName($var1);
Variable #1 - Int. The User ID to return a username for.

This function returns false if the user does not exist. Otherwise, it returns the user's name.

SystemUsernameToID();

SystemUsernameToID(); is a function used to fetch a user id from the specified username. This function accepts one variable.
$api->SystemUsernameToID($var1);
Variable #1 - String. The Username to return a User ID from.

This function returns false if the user does not exist. Otherwise, it returns the user's ID.

SystemItemIDtoName();

SystemItemIDtoName(); is a function used to fetch a item name from the specified item id. This function accepts one variable.
$api->SystemItemIDtoName($var1);
Variable #1 - Int. The Item ID to return a name for.

This function returns false if the item does not exist. Otherwise, it returns the item's name.

SystemItemNametoID();

SystemItemNametoID(); is a function used to fetch a item id from the specified item name. This function accepts one variable.
$api->SystemItemNametoID($var1);
Variable #1 - String. The item name to return a item ID from.

This function returns false if the item does not exist. Otherwise, it returns the item's ID.

SystemTownIDtoName();

SystemTownIDtoName(); is a function used to fetch a town's name from the specified town ID. This function accepts one variable.
$api->SystemTownIDtoName($var1);
Variable #1 - Int. The town ID to return a town name for.

This function returns false if the town does not exist. Otherwise, it returns the town's name.

SystemReturnTax();

SystemReturnTax(); is a function used to return a value inputted, with a tax percentage added onto it.
$api->SystemReturnTax($var1,$var2);
Variable #1 - Int. The number to add the tax percentage to.
Variable #2 - Int. The tax percentage to add onto the number. Optional. If left omitted, it'll fetch the tax percent of the current city the player is in. Enter 0 (Zero) to have no tax.

This function returns the inputted number with the tax added onto it.

SystemReturnTaxOnly();

SystemReturnTaxOnly(); is a function is just like the one before it, but it returns the value of tax added onto the inputted number. (Ex. Function would return 200, if you inputted 1000 as the number, and 20 as the tax percent)
$api->SystemReturnTaxOnly($var1,$var2);
Variable #1 - Int. The number to add the tax percentage to.
Variable #2 - Int. The tax percentage to add onto the number. Optional. If left omitted, it'll fetch the tax percent of the current city the player is in. Enter 0 (Zero) to have no tax.

This function returns the value of tax added onto the inputted number.

SystemCreditTax();

SystemCreditTax(); is a function used to credit a guild with tax.
$api->SystemCreditTax($var1,$var2,$var3);
Variable #1 - Int. The number to add the tax percentage to.
Variable #2 - Int. Currency type to credit. Valid inputs are 1 (Primary) and 2 (Secondary)
Variable #3 - Int. Guild to credit. Optional. If omitted, it'll select the guild ID of the current town. If 0 (zero) is entered, it'll remove the currency from the game.

This function returns nothing.

Clone this wiki locally