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.

This is an old revision of the document!



Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/sfoyston/public_html/TextStorm/Wiki/inc/parser/handler.php on line 1458

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3093 in /home/sfoyston/public_html/TextStorm/Wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

====== TextStorm Functions ====== 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 ===== This allows you to give or take coins from a user. **Function:** public function ModCoins($db, $user, $operation, $amount) To give a user coins: <file php GiveCoins.php> $user->ModCoins($db, $username, "+", 1000000); </file> To take coins from a user: <file php TakeCoins.php> $user->ModCoins($db, $username, "-", 1000000); </file> ===== Modify a User's Experience ===== 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 ===== 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 ===== 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 ===== 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 ===== 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 ===== This allows you to generate a tooltip - when text is hovered over a CSS box will display with more information.


QR Code
QR Code functions (generated for current page)