STRING* character_creation_str="";
STRING* client_username_str="";
STRING* client_password_str="";
function create_character()
{
character_creation = 1;
str_cpy(character_creation_str,"op=7&user=");
str_cat(character_creation_str,client_username_str);
str_cat(character_creation_str,"&pass=");
str_cat(character_creation_str,client_password_str);
str_cat(character_creation_str,"&app=0000000000&pos=0000000x0000000x0000000");
var createchar_http_id = http_sendpost("http://www.mesetts.com/game_req.php",character_creation_str);
while (!http_status(createchar_http_id)) { wait(1); } //wait for the server to reply
if (http_status(createchar_http_id) == 1) //transfer successful?
{
http_result(createchar_http_id,character_creation_str); //get the replied IP
if(str_cmp(character_creation_str,"41") == 1)
{
info_num = 13;
str_cpy((info_txt.pstring)[0],"Character created!\nEntering game...");
pan_controller(info_ok , SHOW_PAN);
}
else
{
info_num = 12;
str_cpy((info_txt.pstring)[0],"Could not create. Please,\ncontact the administrator immediately!\nError code: ");
str_cat((info_txt.pstring)[0],character_creation_str);
pan_controller(info_ok , SHOW_PAN);
}
}
else
{
info_num = 12;
str_cpy((info_txt.pstring)[0],"Could not connect to database server.");
pan_controller(info_ok , SHOW_PAN);
}
http_free(createchar_http_id); //always cleanup the httpid!
}