Guest User

Untitled

a guest
Jun 27th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. if(dialogid == DIALOG_AGE)
  4. {
  5. if(!response)
  6. {
  7. Kick(playerid);
  8. }
  9. else
  10. {
  11. if(strlen(inputtext))
  12. {
  13. new age = strval(inputtext);
  14. if(age > 100 || age < 16)
  15. {
  16. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
  17. }
  18. else
  19. {
  20. PlayerInfo[playerid][pAge] = age;
  21. new
  22. string[ 64 ]
  23. ;
  24. format(string, sizeof(string), "{8EB2D6}Veikėjo informacija: {FFFFFF}jums {8EB2D6}%d {FFFFFF}.",age);
  25. SendClientMessage(playerid, -1, string);
  26. GivePlayerCash(playerid, 600);
  27. SaveAccountStats(playerid);
  28. SpawnPlayer(playerid);
  29. }
  30. }
  31. else
  32. {
  33. return 0;
  34. }
  35. }
  36. }
  37. if(dialogid == DIALOG_SEX)
  38. {
  39. if(response)
  40. {
  41. PlayerInfo[playerid][pSex] = 1;
  42. SendClientMessage(playerid, -1, "{8EB2D6}Veikėjo informacija: {FFFFFF}jūs esate {8EB2D6}vyras.");
  43. SetPlayerSkin(playerid, 60);
  44. PlayerInfo[playerid][pSkin] = 60;
  45. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
  46. }
  47. else
  48. {
  49. PlayerInfo[playerid][pSex] = 2;
  50. SendClientMessage(playerid, -1, "{8EB2D6}Veikėjo informacija: {FFFFFF}jūs esate {8EB2D6}moteris.");
  51. SetPlayerSkin(playerid, 233);
  52. PlayerInfo[playerid][pSkin] = 233;
  53. ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}2/2","Kiek jūsų veikėjui metų?\n\n\n\n{FF0000}(( nuo 16 iki 100 ))","Tęsti","");
  54. }
  55. }
  56. switch( dialogid )
  57. {
  58. case DIALOG_REGISTER:
  59. {
  60. if (!response) return Kick(playerid);
  61. if(response)
  62. {
  63. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}[Registracija] {8EB2D6}City Of Angels: RPG","Norint žaisti mūsų serveryje būtina užsiregistruoti.\n\n\n\nĮrašykite jūsų sugalvotą slaptažodį žėmiau:","Tęsti","Atšaukti");
  64. new INI:File = INI_Open(UserPath(playerid));
  65. INI_SetTag(File,"data");
  66. INI_WriteInt(File,"Password",udb_hash(inputtext));
  67. INI_WriteInt(File,"Cash",0);
  68. INI_WriteInt(File,"Admin",0);
  69. INI_WriteInt(File,"Sex",0);
  70. INI_WriteInt(File,"Age",0);
  71. INI_WriteFloat(File,"Pos_x",0);
  72. INI_WriteFloat(File,"Pos_y",0);
  73. INI_WriteFloat(File,"Pos_z",0);
  74. INI_WriteInt(File,"Skin",0);
  75. INI_Close(File);
  76.  
  77. ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "{8EB2D6}Veikėjo sukūrimas | {FFFFFF}1/2","Pasirinkite jūsų veikėjo lytį.\n\n\n\nDėmėsio: pasirinkta lytis gali įtakoti jūsų tolimėsnį žaidimą.","Vyras","Moteris");
  78. }
  79. }
  80. case DIALOG_LOGIN:
  81. {
  82. if ( !response ) return Kick ( playerid );
  83. if( response )
  84. {
  85. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  86. {
  87. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  88. new
  89. tmp2[ 256 ],
  90. playername2[ MAX_PLAYER_NAME ]
  91. ;
  92. GetPlayerName(playerid, playername2, sizeof(playername2));
  93. format(tmp2, sizeof(tmp2), "~w~Sveikas~n~~g~%s", playername2);
  94. GameTextForPlayer(playerid, tmp2, 5000, 1);
  95. SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
  96. GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  97. SetSpawnInfo(playerid, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
  98. }
  99. else
  100. {
  101. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FFFFFF}[Prisijungimas] {8EB2D6}City Of Angels: RPG","{FFFFFF}Norint tęsti savo žaidimą mūsų serveryje būtina prisijungti.\n\n\n\nĮrašykite slaptažodį žėmiau:","Tęsti","Atšaukti");
  102. }
  103. return 1;
  104. }
  105. }
  106. }
  107. return 1;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment