Guest User

Untitled

a guest
Oct 15th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. forward CheckIfAccountExists(playerid, accountName[24]);
  2. public CheckIfAccountExists(playerid, accountName[24])
  3. {
  4. new query[128];
  5. mysql_format(db, query, sizeof(query), "SELECT uName FROM logindata WHERE uName = '%e';", accountName);
  6. mysql_function_query(db, query, false, "OnRequestNickRegistered", "i", playerid);
  7. }
  8.  
  9. forward public OnRequestNickRegistered(playerid);
  10. public OnRequestNickRegistered(playerid)
  11. {
  12. new rows = cache_num_rows();
  13. new msg[128], name[128];
  14. if(rows)
  15. {
  16. format(msg, sizeof(msg), "Player %s exists in the database", playerName);
  17. SendClientMessage(playerid, COLOR_GREEN, msg);
  18.  
  19. GetPlayerName(playerid, name, sizeof(name));
  20. format(msg, sizeof(msg), "Admin %s has just checked if the player %s exists in the database and he does.", name, playerName);
  21. print(msg);
  22. }
  23. else
  24. {
  25. format(msg, sizeof(msg), "Player %s doesn't exist in the database", playerName);
  26. SendClientMessage(playerid, COLOR_RED, msg);
  27.  
  28. GetPlayerName(playerid, name, sizeof(name));
  29. format(msg, sizeof(msg), "Admin %s has just checked if the player %s exists in the database and he doesn't.", name, playerName);
  30. print(msg);
  31. }
  32. return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment