30.01.2017, 17:09
Why does AccLock get a random value? Not really random, so far it got 110, 98 and 97.
This is how I save AccLock it is somewhere at the end.
This is the enum
This is how I load it:
This checks if the account is locked:
This is how I save AccLock it is somewhere at the end.
Код:
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `USERS` SET `Sex` = '%d', `Age` = '%d', `Pos_x` = '%f', `Pos_y` = '%f', `Pos_z` = '%f', `Skin` = '%d', `Job` = '%d', `AccLock` = '%d' WHERE `USERNAME` = '%e'" , PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pAccLock], pName); mysql_tquery(Database, DB_Query);
Код:
enum pInfo { ID, pPass[65], Salt[11], PasswordFails, Kills, Score, Deaths, pCash, pAdmin, pSex, pAge, Float:pPos_x, Float:pPos_y, Float:pPos_z, pSkin, pTeam, pAccent, Cache: Player_Cache, LoggedIn, pEmail, pAccLock }
Код:
cache_get_value_int(0, "AccLock", PlayerInfo[playerid][pAccLock]);
Код:
if(PlayerInfo[playerid][pAccLock] == 1) { new string[80]; SendClientMessage(playerid, COLOR_GREEN, "SERVER: This account is locked, visit the forum to unlock it!"); SendClientMessage(playerid, COLOR_GREEN, "> xxxxxxx"); SetTimerEx("KickPlayer",500,false,"i",playerid); format(string, sizeof(string), "WARNING: %s tried to log into a locked account.", RPName(playerid)); SendAdminMessage(COLOR_YELLOW, string); LockLog(string); }