01.01.2019, 23:21
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; } |
Quote:
printf("» Playerid: %i - Corruptid: %i - Name: %s", playerid, CORRUPT_CHECK[playerid], PLAYER_DATA[playerid][PLAYER_NAME]); |
Next when the OnPlayerDataCheck is being called the
Quote:
print("» OnPlayerDataCheck called."); |