Register & Login Dialog not showing up?
#1

Quote:

public OnPlayerConnect(playerid)
{
MySQL_QUERY[0] = EOS;
PLAYER_DATA[playerid][PLAYER_KILLS] = 0;
PLAYER_DATA[playerid][PLAYER_DEATHS] = 0;
PLAYER_DATA[playerid][PLAYER_PASSWORD_FAILS] = 0;

GetPlayerName(playerid, PLAYER_DATA[playerid][PLAYER_NAME], MAX_PLAYER_NAME);
CORRUPT_CHECK[playerid] ++;

mysql_format(MySQL_CHECK, MySQL_QUERY, sizeof(MySQL_QUERY), "SELECT * FROM `PLAYERS_FOLDER` WHERE `USERNAME` = '%e' LIMIT 1", PLAYER_DATA[playerid][PLAYER_NAME]);
mysql_tquery(MySQL_CHECK, MySQL_QUERY, "OnPlayerDataCheck", "ii", playerid, CORRUPT_CHECK[playerid]);
printf("» Playerid: %i - Corruptid: %i - Name: %s", playerid, CORRUPT_CHECK[playerid], PLAYER_DATA[playerid][PLAYER_NAME]);
return 1;
}

forward OnPlayerDataCheck(playerid, corrupt_check);
public OnPlayerDataCheck(playerid, corrupt_check)
{
TEXT_STRING[0] = EOS;
print("» OnPlayerDataCheck called.");

if(corrupt_check != CORRUPT_CHECK[playerid]) return Kick(playerid);
if(cache_num_rows() > 0)
{
cache_get_value(0, "PASSWORD", PLAYER_DATA[playerid][PLAYER_PASSWORD], 65);
cache_get_value(0, "SALT", PLAYER_DATA[playerid][PLAYER_SALT], 11);

PLAYER_DATA[playerid][PLAYER_CACHE] = cache_save();
format(TEXT_STRING, sizeof(TEXT_STRING), "Welcome back %s.\n\nThis username is already registered in our database!\n\
Please input your password below to proceed to the game.\n\n", PLAYER_DATA[playerid][PLAYER_NAME]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN SYSTEM", TEXT_STRING, "LOGIN", "LEAVE");
} else {
format(TEXT_STRING, sizeof(TEXT_STRING), "Welcome %s.\n\nThis username is not registered in our database!\n\
Please input your password below to proceed to the game.\n\n", PLAYER_DATA[playerid][PLAYER_NAME]);
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "LOGIN SYSTEM", TEXT_STRING, "LOGIN", "LEAVE");
}
return 1;
}

So when I join to my server and try to register the dialog is not showing up for some reason? What am I doing wrong? I cannot see any mistakes in this code.

Quote:

printf("» Playerid: %i - Corruptid: %i - Name: %s", playerid, CORRUPT_CHECK[playerid], PLAYER_DATA[playerid][PLAYER_NAME]);

This code comes out as Playerid: 0 - Corruptid: 1 - Name: feheristi97

Next when the OnPlayerDataCheck is being called the

Quote:

print("» OnPlayerDataCheck called.");

is not being shown.. so basically the OnPlayerDataCheck is not working for some reason and I do not get it why? Help would be usefull!
Reply
#2

https://www.youtube.com/watch?v=quDmpsgA6Fk
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)