Advertisement
Guest User

all in one by mackenzi

a guest
Jun 13th, 2018
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. //Hostname, rcon change i sifra servera all in one
  2.  
  3. #include < a_samp >
  4.  
  5. enum
  6. {
  7. dialog_rconpanel,
  8. dialog_rconpanel1,
  9. dialog_rconpanel2,
  10. dialog_rconpanel3
  11. }
  12.  
  13.  
  14. COMMAND:izmenisve(playerid, params[])
  15. {
  16. ShowPlayerDialog(playerid, dialog_rconpanel ,DIALOG_STYLE_LIST,"{FFFFFF}Izaberite","Gamemode Name\nServer Ime\nRcon Password","Odaberi","Izadji");
  17. return 1;
  18. }
  19.  
  20. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  21. {
  22. if(dialogid == dialog_rconpanel)
  23. {
  24. if(response)
  25. {
  26. if(listitem == 0)
  27. {
  28. ShowPlayerDialog(playerid,dialog_rconpanel1,DIALOG_STYLE_INPUT,"{FFFFFF}Gamemode","Postavite novo ime Gamemodea/Verzija skripte","Postavi","Izadji");
  29. }
  30. if(listitem == 1)
  31. {
  32. ShowPlayerDialog(playerid,dialog_rconpanel2,DIALOG_STYLE_INPUT,"{FFFFFF}Server Ime","Postavite novo ime servera","Postavi","Izadji");
  33. }
  34. if(listitem == 2)
  35. {
  36. ShowPlayerDialog(playerid,dialog_rconpanel3,DIALOG_STYLE_INPUT,"{FFFFFF}Rcon Password","Postavite novi Rcon password","Postavi","Izadji");
  37. }
  38. }
  39. }
  40. else if(dialogid == dialog_rconpanel1)
  41. {
  42. new string[128];
  43. if(response)
  44. {
  45. format(string,sizeof(string),"%s",inputtext);
  46. SetGameModeText(string);
  47. MessageEx(playerid, -1,"{FFFFFF} %s upravo si promenio ime gamemoda/verzije na: '%s' !",GetName(playerid),inputtext);
  48. }
  49. }
  50. else if(dialogid == dialog_rconpanel2)
  51. {
  52. new string[150];
  53. if(response)
  54. {
  55. format(string,sizeof(string),"hostname %s",inputtext);
  56. SendRconCommand(string);
  57. MessageEx(playerid, -1,"{FFFFFF} %s upravo si promenio ime servera na: '%s'!",GetName(playerid),inputtext);
  58. }
  59. }
  60. else if(dialogid == dialog_rconpanel3)
  61. {
  62. new string[128];
  63. if(response)
  64. {
  65. format(string,sizeof(string),"rcon_password %s",inputtext);
  66. SendRconCommand(string);
  67. MessageEx(playerid, -1, "{FFFFFF} %s upravo si promenio rcon password na: '%s'!",GetName(playerid),inputtext);
  68. }
  69. }
  70. return 1;
  71. }
  72.  
  73. stock MessageEx(playerid,color,fstring[],{Float, _}:...)
  74. {
  75. new n=(numargs()-3)*4;
  76. if(n)
  77. {
  78. new message[128],arg_start,arg_end;
  79. #emit CONST.alt fstring
  80. #emit LCTRL 5
  81. #emit ADD
  82. #emit STOR.S.pri arg_start
  83. #emit LOAD.S.alt n
  84. #emit ADD
  85. #emit STOR.S.pri arg_end
  86. do
  87. {
  88. #emit LOAD.I
  89. #emit PUSH.pri
  90. arg_end-=4;
  91. #emit LOAD.S.pri arg_end
  92. }
  93. while(arg_end>arg_start);
  94. #emit PUSH.S fstring
  95. #emit PUSH.C 255
  96. #emit PUSH.ADR message
  97. n+=4*3;
  98. #emit PUSH.S n
  99. #emit SYSREQ.C format
  100. n+=4;
  101. #emit LCTRL 4
  102. #emit LOAD.S.alt n
  103. #emit ADD
  104. #emit SCTRL 4
  105. return SendClientMessage(playerid,color,message);
  106. }
  107. else return SendClientMessage(playerid,color,fstring);
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement