GML - Adding a Registration System

From Global Programming Syntax

Jump to: navigation, search

Sometimes you may want to have a registration system for your game. Well the following script has a basic one that will stop those gamers from using parts of the game without registration.

Example Code

In this script, you will learn how to add a registration system to your game. To make things better (if you have a website), you can monitor each registration that has been made. So create an object and place it in the first room. In the object that you have placed in the first room, add the following GML to the 'Game Start' event.

if !registry_exists_ext('19df745hjfd64','gamereg') then
{
code = get_string("Enter activation code.","");
if code = "19df745hjfd64"
{
execute_shell('http://www.yoursite.com/activationpage.php',0);
registry_write_real_ext('19df745hjfd64','gamereg','1');
game_end();
}
}

Remember to replace the code 19df745hjfd64 with your registration code. Then replace http://www.yoursite.com/activationpage.php with the page on your site with a page that says the activation is complete and add to the page an ip recorder and a date accessed beside the recorded ip. Or you could just delete the following line:

execute_shell('http://www.yoursite.com/activationpage.php',0);
Personal tools
languages
page stats
Toolbox