Score – Giavapps Game Jolt API

 

About Score Functions

 

For more info about Score functions please visit the following link: http://gamejolt.com/game-api/doc/scores

 

Score Functions

 

gj_score_fetch_primary(double limit) Retrieves a list of scores from primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_primary_better_than(double limit, double better_than) Retrieves a list of scores from primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_primary_worse_than(double limit, double worse_than) Retrieves a list of scores from primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_fetch_table(double table_id, double limit) Retrieves a list of scores from a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_table_better_than(double table_id, double limit, double better_than) Retrieves a list of scores from a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_table_worse_than(double table_id, double limit, double worse_than) Retrieves a list of scores from a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_fetch_user_primary(double limit) Retrieves a list of scores from primary score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_user_primary_better_than(double limit, double better_than) Retrieves a list of scores from primary score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_user_primary_worse_than(double limit, double worse_than) Retrieves a list of scores from primary score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_fetch_user_table(double table_id, double limit) Retrieves a list of scores from a specific score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_user_table_better_than(double table_id, double limit, double better_than) Retrieves a list of scores from a specific score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_user_table_worse_than(double table_id, double limit, double worse_than) Retrieves a list of scores from a specific score table for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_fetch_guest_primary(string guest, double limit) Retrieves a list of scores from primary score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_guest_primary_better_than(string guest, double limit, double better_than) Retrieves a list of scores from primary score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_guest_primary_worse_than(string guest, double limit, double worse_than) Retrieves a list of scores from primary score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_fetch_guest_table(string guest, double table_id, double limit) Retrieves a list of scores from a specific score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

 

gj_score_fetch_guest_table_better_than(string guest, double table_id, double limit, double better_than) Retrieves a list of scores from a specific score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double better_than: fetch only scores better than this score sort value.

 

gj_score_fetch_guest_table_worse_than(string guest, double table_id, double limit, double worse_than) Retrieves a list of scores from a specific score table for a guest. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/fetch

string guest: the guest’s name.

double table_id: the id of the high score table that you want to get high scores for.

double limit: the number of scores you’d like to return. The maximum amount of scores you can retrieve is 100.

double worse_than: fetch only scores worse than this score sort value.

 

gj_score_add_user_primary(string score, double sort, string extra_data) Adds a score for the user in the primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/add

string score: this is a string value associated with the score. (Example: “100 Points”)

double sort: this is a numerical sorting value associated with the score. All sorting will work off of this number. (Example: 100).

string extra_data: If there’s any extra data you would like to store (as a string), you can use this variable.

 

gj_score_add_user_table(double table_id, string score, double sort, string extra_data) Adds a score for the user in a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/add

double table_id: the id of the high score table that you want to submit to.

string score: this is a string value associated with the score. (Example: “100 Points”)

double sort: this is a numerical sorting value associated with the score. All sorting will work off of this number. (Example: 100).

string extra_data: If there’s any extra data you would like to store (as a string), you can use this variable.

 

gj_score_add_guest_primary(string guest, string score, double sort, string extra_data) Adds a score for a guest in the primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/add

string guest: the guest’s name.

string score: this is a string value associated with the score. (Example: “100 Points”)

double sort: this is a numerical sorting value associated with the score. All sorting will work off of this number. (Example: 100).

string extra_data: If there’s any extra data you would like to store (as a string), you can use this variable.

 

gj_score_add_guest_table(string guest, double table_id, string score, double sort, string extra_data) Adds a score for a guest in a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/add

string guest: the guest’s name.

double table_id: the id of the high score table that you want to submit to.

string score: this is a string value associated with the score. (Example: “100 Points”)

double sort: this is a numerical sorting value associated with the score. All sorting will work off of this number. (Example: 100).

string extra_data: If there’s any extra data you would like to store (as a string), you can use this variable.

 

gj_score_get_rank_primary(double sort) Returns the rank of a particular score on the primary score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/get-rank

double sort: this is a numerical sorting value that is represented by a rank on the score table. (Example: 100).

 

gj_score_get_rank_table(double table_id, double sort) Returns the rank of a particular score on a specific score table. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/get-rank

double table_id: the id of the score table from which you want to get the rank.

double sort: this is a numerical sorting value that is represented by a rank on the score table. (Example: 100).

 

gj_score_tables() Returns a list of high score tables for a game. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/scores/tables

 

Code Examples

 

Adding A Score For The User

 

Create Event

 

gj_init("game_id","private_key");//Initializes Giavapps Game Jolt API
request_user_auth = gj_user_auth("username","user_token");//Authenticates the user
request_score_add_user_primary = –1;//Request for adding score in the primary score table

 

Game End Event

 

gj_deinit();//Deinitializes Giavapps Game Jolt API

 

Async – HTTP Event

 

if(gj_http_status() != 0){exit;}//Checks if the status is complete

gj_http_result();//Retrieves result data for gj_result_* functions

if(gj_http_id() == request_user_auth)//Checks if the id is equal to the http request id
{

if(gj_result_success())
{

show_debug_message("THE USER’S CREDENTIALS ARE VALID!");
request_score_add_user_primary = gj_score_add_user_primary("100 Points",100,"");//Adds a new score for the user

}

else
{

show_debug_message("THE USER’S CREDENTIALS ARE INVALID!");

}

}
else if(gj_http_id() == request_score_add_user_primary)//Checks if the id is equal to the http request id
{

if(gj_result_success())
{

show_debug_message("SCORE HAS BEEN ADDED!");

}
else
{

show_debug_message("SCORE HAS NOT BEEN ADDED!");

}

}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Comments are closed.