Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OnPlayerConnect
- new query[256], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, 24);
- mysql_format(mysql, query, sizeof(query),"SELECT `players_id`, `players_mdp`, `players_ban`, `players_register` FROM `players` WHERE `players_name` = '%e' LIMIT 1", name);
- mysql_tquery(mysql, query, "AccountCheck", "d", playerid);
- // AccountCheck
- forward AccountCheck(playerid);
- public AccountCheck(playerid)
- {
- new annee, jour, mois, string[520];
- getdate(annee, mois, jour);
- if(cache_num_rows() > 0)
- {
- if(Players[playerid][Ban] == 0)
- {
- cache_get_field_content(0, "players_pass", Players[playerid][Password], mysql, 129);
- Players[playerid][ID] = cache_get_field_content_int(0, "Players_id");
- format(string, sizeof(string), "Hello %s, today : %02d/%02d/%d, last version : %s \nEnter your password to join the server", GetName(playerid), jour, mois, annee, VERSION);
- Dialog_Show(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Log me", "Cancel");
- }
- else
- {
- KickWithMessage(playerid, -1, ""jaune2"[Console]: "blanc"You're banned from this server.");
- }
- }
- else
- {
- Dialog_Show(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Welcome to the server.\nEnter password to create your account !", "Register", "Cancel");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment