Guest User

Untitled

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.85 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #include "../include/gl_common.inc"
  4.  
  5. #include <core>
  6.  
  7. #include <a_mysql>
  8.  
  9. #include <float>
  10.  
  11. public OnGameModeInit()
  12. {
  13.     mysql_connect("localhost", "root", "serveurgta", "");
  14.    
  15.     return 1;
  16. }
  17.  
  18. public OnGameModeExit()
  19. {
  20.     mysql_close();
  21.     return 1;
  22. }
  23.  
  24. public OnPlayerConnect(playerid)
  25. {
  26.     new sUsername[MAX_PLAYER_NAME],
  27.         sQuery[256];
  28.    
  29.     GetPlayerName(playerid, sUsername, sizeof(sUsername));
  30.     format(sQuery, sizeof(sQuery), "SELECT * FROM `membres` WHERE `Nom_Ig`='%s' LIMIT 1;", sUsername);
  31.     mysql_query(sQuery);
  32.     mysql_store_result();
  33.    
  34.     if (mysql_num_rows() == 1)
  35.         SendClientMessage(playerid, 0x1D76E2FF, "Votre compte existe !");
  36.     else
  37.         SendClientMessage(playerid, 0x1D76E2FF, "Votre compte n'existe pas !");
  38.    
  39.     mysql_free_result();
  40.     return 1;
  41. }
Add Comment
Please, Sign In to add comment