Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. // Login
  2. mysql_format(SQL, szString, 63,"SELECT * FROM `users` WHERE `name`='%s'",GetName(playerid));
  3. new Cache: loginverificare = mysql_query(SQL,szString);
  4. if(cache_get_row_count() > 0) {
  5. PlayerAccount[playerid] = 1; }
  6. else {
  7. PlayerAccount[playerid] = 0; }
  8.  
  9. function CheckClassIP(playerid) {
  10. if(!RegistrationStep[playerid] && IsPlayerLogged[playerid] != 1) {
  11. SetPlayerFacingAngle(playerid, 3.41);
  12. SetPlayerPosEx(playerid, 1479.3499, -1748.4355, 45.1615);
  13. SetPlayerInterior(playerid, 0);
  14. TogglePlayerControllable(playerid, false);
  15.  
  16. if(PlayerAccount[playerid] != 0) {
  17. new lastonline[64], string[256];
  18. mysql_format(SQL, string, sizeof string, "SELECT `lastOn` FROM `users` WHERE `name` = '%s'", GetName(playerid));
  19. mysql_tquery(SQL, string, "", "");
  20. if(cache_get_row_count()) cache_get_field_content(0, "lastOn", lastonline, 64);
  21.  
  22. format(string, sizeof(string), "Bine ai revenit, %s!\nTasteaza in casuta de mai jos parola contului tau.\n\nUltima logare: {FFFFFF}%s",GetName(playerid),lastonline);
  23. ShowPlayerDialog(playerid, DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"Logare", string,"Logare","Quit");
  24. }
  25. else {
  26. new string[200];
  27. PlayerAccount[playerid] = 0;
  28. format(string, sizeof(string), "Bine ai venit, %s!\nAcest cont nu este inregistrat.\n\nPentru a-ti creea unul, introdu o parola in casuta de mai jos.",GetName(playerid));
  29. ShowPlayerDialog(playerid, DIALOG_LOGIN1,DIALOG_STYLE_PASSWORD,"Register", string,"Register","Quit");
  30. }
  31. }
  32. return 1;
  33. }
  34. function MySQLCheckAccount(sqlplayersname[]) {
  35. new escstr[30];
  36. mysql_escape_string(sqlplayersname, escstr);
  37. format(szQuery, 71, "SELECT * FROM `users` WHERE `name`='%s' LIMIT 1", escstr);
  38. new Cache: result = mysql_query(SQL, szQuery);
  39. new test = cache_get_row_count();
  40. cache_delete(result);
  41. if(test != 0) return true;
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement