Advertisement
Guest User

dialog_login

a guest
Sep 18th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. public OnPlayerRequestClass(playerid, classid)
  2. {
  3. if(gPlayerLogged[playerid] == 1)
  4. {
  5. if(ChosenSkin[playerid] == 1) return SpawnPlayer(playerid);
  6.  
  7. }
  8. if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
  9. {
  10. SetPlayerInterior(playerid,0);
  11. SetPlayerPos(playerid, 1742.9814,-1863.0938,16.2048);
  12. InterpolateCameraPos(playerid, 1804.1313,-1732.0179,21.7294, 1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
  13. InterpolateCameraLookAt(playerid,1441.6654,-1732.0317,18.0373,1037.3715,-1732.7358,25.2859, 30000, CAMERA_MOVE);
  14. TogglePlayerControllable(playerid, 0);
  15. if (gPlayerAccount[playerid] != 0)
  16. {
  17. new loginstring[320],
  18. loginname[64],
  19. laston[64],
  20. field[128];
  21. GetPlayerName(playerid,loginname,sizeof(loginname));
  22. format(field,128,"SELECT `lastOn` FROM users WHERE `name`='%s'",loginname);
  23. mysql_query(SQL,field);
  24. mysql_store_result();
  25. if(mysql_retrieve_row())
  26. {
  27. mysql_fetch_field_row(laston, "lastOn");
  28. }
  29. mysql_free_result();
  30. SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}Welcome to RULEPLAY RPG.");
  31. SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}You already have a registered account, please enter your password into the dialog box.");
  32. format(loginstring,sizeof(loginstring),"Welcome to the RULEPLAY RPG Server.\nPlease enter your password below!");
  33. ShowPlayerDialog(playerid,DIALOG_LOGIN2,DIALOG_STYLE_PASSWORD,"SERVER: Login",loginstring,"Login","Cancel");
  34. }
  35. else
  36. {
  37. gPlayerAccount[playerid] = 0;
  38. new regstring[200],
  39. regname[64],
  40. loginname[158],
  41. stringgg[300];
  42. GetPlayerName(playerid,loginname,sizeof(loginname));
  43. for(new clanid; clanid < MAX_CLANS; clanid++)
  44. {
  45. if(strfind(loginname,ClanInfo[clanid][cClanTag],true) != -1)
  46. {
  47. format(stringgg,sizeof(stringgg),"Nu poti folosi acel username. '%s' este inregistrat de un clan. Nu poti folosi acel cuvant in nickname-ul tau.",ClanInfo[clanid][cClanTag]);
  48. SendClientMessage(playerid, COLOR_RED, stringgg);
  49. format(stringgg,sizeof(stringgg),"You can't use that username! '%s' is a registered clan tag. You can't use that word in your nickname.",ClanInfo[clanid][cClanTag]);
  50. SendClientMessage(playerid, COLOR_RED, stringgg);
  51. KickEx(playerid);
  52. }
  53. }
  54. GetPlayerName(playerid,regname,sizeof(regname));
  55. SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}Welcome to RULEPLAY RPG.");
  56. SendClientMessage(playerid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}You aren't registered yet. Please enter your desired password in the dialog box to register.");
  57. format(regstring,sizeof(regstring),"Welcome to the RULEPLAY RPG Server.\nPlease enter your desired password below!");
  58. ShowPlayerDialog(playerid,DIALOG_LOGIN1,DIALOG_STYLE_PASSWORD,"SERVER: Registration",regstring,"Register","Cancel");
  59. }
  60. login[playerid] = SetTimerEx("Logink",60000,false,"d",playerid);
  61. }
  62. else if(IsPlayerNPC(playerid)) return 1;
  63. return 1;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement