Guest User

Untitled

a guest
Jan 26th, 2015
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.35 KB | None | 0 0
  1. // OnPlayerConnect
  2. new query[256], name[MAX_PLAYER_NAME];
  3.     GetPlayerName(playerid, name, 24);
  4.     mysql_format(mysql, query, sizeof(query),"SELECT `players_id`, `players_mdp`, `players_ban`, `players_register` FROM `players` WHERE `players_name` = '%e' LIMIT 1", name);
  5.     mysql_tquery(mysql, query, "AccountCheck", "d", playerid);
  6.  
  7. // AccountCheck
  8.  
  9. forward AccountCheck(playerid);
  10. public AccountCheck(playerid)
  11. {
  12.     new annee, jour, mois, string[520];
  13.     getdate(annee, mois, jour);
  14.     if(cache_num_rows() > 0)
  15.     {
  16.         if(Players[playerid][Ban] == 0)
  17.         {
  18.             cache_get_field_content(0, "players_pass", Players[playerid][Password], mysql, 129);
  19.             Players[playerid][ID] = cache_get_field_content_int(0, "Players_id");
  20.             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);
  21.             Dialog_Show(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Log me", "Cancel");
  22.         }
  23.         else
  24.         {
  25.             KickWithMessage(playerid, -1, ""jaune2"[Console]: "blanc"You're banned from this server.");
  26.         }
  27.     }
  28.     else
  29.     {
  30.         Dialog_Show(playerid, REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Welcome to the server.\nEnter password to create your account !", "Register", "Cancel");
  31.     }
  32.     return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment