Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php on line 560

Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/auth.php on line 495

Warning: Cannot modify header information - headers already sent by (output started at /home/sfoyston/public_html/TextStorm/Wiki/inc/init.php:560) in /home/sfoyston/public_html/TextStorm/Wiki/inc/actions.php on line 210
functions - TextStorm Wiki

The Wiki is still in development, please bare with us while we add and update content.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
functions [2016/12/05 21:42]
textstorm
functions [2016/12/05 22:18] (current)
textstorm
Line 1: Line 1:
 ====== TextStorm Functions ====== ====== TextStorm Functions ======
 Below you will find the details of TextStorms in-built functions and their usage. Below you will find the details of TextStorms in-built functions and their usage.
 +
 +You will need to instantiate the User class to access these functions.
 +<file php AccessClass.php>​
 +$user = new User;
 +</​file>​
 +**Note: If you are developing a plugin, $user is already available to you!**
 ===== Modify a User's Coins ===== ===== Modify a User's Coins =====
 This allows you to give or take coins from a user. This allows you to give or take coins from a user.
  
-Function: public function ModCoins($db,​ $user, $operation, $amount)+**Function:** public function ModCoins($db,​ $user, $operation, $amount)
  
 To give a user coins: To give a user coins:
 <file php GiveCoins.php>​ <file php GiveCoins.php>​
 $user->​ModCoins($db,​ $username, "​+",​ 1000000); $user->​ModCoins($db,​ $username, "​+",​ 1000000);
 +</​file>​
 +To take coins from a user:
 +<file php TakeCoins.php>​
 +$user->​ModCoins($db,​ $username, "​-",​ 1000000);
 </​file>​ </​file>​
 ===== Modify a User's Experience ===== ===== Modify a User's Experience =====
 This allows you to give or take experience from a user. This allows you to give or take experience from a user.
 +
 +**Function:​** public function ModExperience($db,​ $user, $operation, $amount)
 +
 +To give a user experience:
 +<file php GiveExperience.php>​
 +$user->​ModExperience($db,​ $username, "​+",​ 1000000);
 +</​file>​
 +To take experience from a user:
 +<file php TakeExperience.php>​
 +$user->​ModExperience($db,​ $username, "​-",​ 1000000);
 +</​file>​
 ===== Give a User a Vehicle ===== ===== Give a User a Vehicle =====
 This allows you to give the user a new vehicle from the Vehicle Store This allows you to give the user a new vehicle from the Vehicle Store
 +
 +**Function:​** public function GiveVehicle($db,​ $user, $vehicleid)
 +
 +To give a user a vehicle:
 +<file php GiveVehicle.php>​
 +//the below would give the user vehicle ID 27 from the vehiclestore table
 +$user->​GiveVehicle($db,​ $username, 27);
 +</​file>​
 +
 ===== Give a User a Weapon ===== ===== Give a User a Weapon =====
 This allows you to give the user a new weapon from the Weapon Store This allows you to give the user a new weapon from the Weapon Store
 +
 +**Function:​** public function GiveWeapon($db,​ $user, $weaponid)
 +
 +To give a user a weapon:
 +<file php GiveWeapon.php>​
 +//the below would give the user weapon ID 27 from the weaponstore table
 +$user->​GiveWeapon($db,​ $username, 27);
 +</​file>​
 ===== Give a User a Chest ===== ===== Give a User a Chest =====
 This allows you to give a user a chest that is configured in the Administration Panel This allows you to give a user a chest that is configured in the Administration Panel
 +
 +**Function:​** public function GiveChest($db,​ $reason)
 +
 +To give a user a chest:
 +<file php GiveChest.php>​
 +//the below would give the user the chest with the reason "​Hull"​ in the Admin Panel
 +$user->​GiveChest($db,​ "​Hull"​);​
 +</​file>​
 ===== Send a User a System Message ===== ===== Send a User a System Message =====
 This allows you to send a user a message from the System user This allows you to send a user a message from the System user
 +
 +**Function:​** public function SysMessage($db,​ $username, $message)
 +
 +To send a System message to a user:
 +<file php SystemMessage.php>​
 +//The below would send a message to Steve from the System user telling him he won the race and how much he won
 +$user->​SysMessage($db,​ "​Steve",​ "You have won the race and received $coins coins!"​);​
 +</​file>​
 ===== Generate a Tooltip ===== ===== Generate a Tooltip =====
 This allows you to generate a tooltip - when text is hovered over a CSS box will display with more information. This allows you to generate a tooltip - when text is hovered over a CSS box will display with more information.
 +
 +**Function:​** public function GenTooltip($text,​ $tiptext)
 +
 +To display a tooltip:
 +<file php GenerateToolTip.php>​
 +$user->​GenTooltip("​Hover over me", "This is some information displayed when you hover over the text"​);​
 +</​file>​
 +===== User Logging =====
 +This allows you to log a user action to the database for administrators to view
 +
 +**Function:​** public function UserLogging($db,​ $loguser, $logreason)
 +
 +To create a log:
 +<file php UserLogging.php>​
 +$user->​UserLogging($db,​ "​Steve",​ "​Opened the chest with ID: $id");
 +</​file>​

QR Code
QR Code functions (generated for current page)