Repository navigation
Game API
The Game API is useful when you need to do game actions, such as sending mail, events or announcements.
GameAddNotification();
GameAddMail();
GameAddAnnouncement();
GameBuyItem();
GameAddNotification(); is a function used to send a notification to a player. This function takes two variables.
$api->GameAddNotification($var1,$var2);
Variable #1 - Integer. Specifies the user testing on.
Variable #2 - Text. Message sent along with the notification.
This function always returns true.
GameAddMail(); is a function used to send a message via in-game inbox to a player. This function takes four variables.
$api->GameAddMail($var1,$var2,$var3,$var4);
Variable #1 - Integer. Specifies the user testing on.
Variable #2 - Text. Message subject.
Variable #3 - Text. Message text.
Variable #4 - Integer. User ID the message is sent from.
This function returns true when the message is sent successfully. False if the message fails to send.
GameAddAnnouncement(); is a function used to create a game announcement. This function uses two variables, one of which is optional.
$api->GameAddAnnouncement($var1,$var2);
Variable #1 - Text. Text to be shown in the announcement.
Variable #2 - Integer. User ID of poster. Optional. [Defaults to ID 1]
This function returns true when the announcement is created successfully. False if otherwise.
GameBuyItem(); is a function used to do basic checks and actions for when a user wishes to buy an item. It accepts five variables!
$api->GameBuyItem($var1,$var2,$var3,$var4,$var5);
Variable #1 - Integer. User to give item to, if bought successfully.
Variable #2 - Integer. Currency type. [1 = Primary, 2 = Secondary]
Variable #2 - Integer. Cost of item.
Variable #2 - Integer. Item to buy.
Variable #2 - Integer. Quantity of item to buy. Optional. [Default: 1]
This function returns true when the item has been bought successfully. False if the user does not have the currency for the item, or if the item does not exist.
Current Chivalry Engine Versions:
V1 - 1.0.3b released March 21, 2025
V2 - 2.0.2 released Jun 13, 2020
V3- 3.0.0-alpha1 released Sept 29, 2019