Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
functions [2016/12/05 22:08] textstorm |
functions [2016/12/05 22:18] textstorm |
||
---|---|---|---|
Line 46: | Line 46: | ||
===== 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 | ||
- | |||
- | This allows you to give the user a new vehicle from the Vehicle Store | ||
**Function:** public function GiveWeapon($db, $user, $weaponid) | **Function:** public function GiveWeapon($db, $user, $weaponid) | ||
Line 58: | Line 56: | ||
===== 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> |