Skip to content

Game API

MasterGeneral156 edited this page Nov 10, 2016 · 6 revisions

The Game API

The Game API is useful when you need to do game actions, such as sending mail, events or announcements. ##Available Functions
GameAddNotification();
GameAddMail();
GameAddAnnouncement();
##GameAddNotification();
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();
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();
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.

Clone this wiki locally