Advertisement
Guest User

User Control Panel [In - Game]

a guest
Mar 15th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. #define DIALOG_UCP 1
  6. #define HP SetPlayerHealth
  7. #define SCM SendClientMessage
  8. #define SCMA SendClientMessageToAll
  9. #define Kapcsolat(%0) ((%0)?("Bekapcsolva"):("Kikapcsolva"))
  10.  
  11. #pragma tabsize 0
  12.  
  13. new AFK[MAX_PLAYERS];
  14. new GOD[MAX_PLAYERS];
  15. new string[512];
  16.  
  17. public OnPlayerConnect(playerid)
  18. {
  19. AFK[playerid]=0;
  20. GOD[playerid]=0;
  21. return 1;
  22. }
  23.  
  24. public OnPlayerDisconnect(playerid, reason)
  25. {
  26. AFK[playerid]=0;
  27. GOD[playerid]=0;
  28. return 1;
  29. }
  30.  
  31. CMD:ucp(playerid,params[])
  32. {
  33. format(string,sizeof(string), "Nincs Gépnél : %s [/afk]\nHalhatatlanság : %s [/god]\n",Kapcsolat(AFK[playerid]),Kapcsolat(GOD[playerid]));
  34. ShowPlayerDialog(playerid,DIALOG_UCP,DIALOG_STYLE_LIST,"Játékos Kezelő Fülke [In - Game]",string,"Választ","Kilépés");
  35. return 1;
  36. }
  37.  
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40. if(dialogid == DIALOG_UCP)
  41. {
  42. if(response)
  43. {
  44. if(listitem == 0)
  45. {
  46. if(GetPVarInt(playerid,"AFK") == 0)
  47. {
  48. AFK[playerid] = 1;
  49. SetPVarInt(playerid,"AFK",1);
  50. TogglePlayerControllable(playerid,false);
  51. format(string, sizeof(string), "{AA3333}[AFK] {CECECE}%s {AA3333}Nem Elérhető !",pName(playerid));
  52. SCMA(-1, string);
  53. return cmd_ucp(playerid);
  54. }
  55. else if(GetPVarInt(playerid,"AFK") == 1 )
  56. {
  57. AFK[playerid] = 0;
  58. SetPVarInt(playerid, "AFK",0);
  59. TogglePlayerControllable(playerid,true);
  60. format(string, sizeof(string), "{AA3333}[AFK] {CECECE}%s {AA3333}Elérhető !",pName(playerid));
  61. SCMA(-1, string);
  62. return cmd_ucp(playerid);
  63. }
  64. }
  65. if(listitem == 1)
  66. {
  67. if(GetPVarInt(playerid,"GOD") == 0)
  68. {
  69. GOD[playerid] = 1;
  70. SetPVarInt(playerid,"GOD",1);
  71. HP(playerid,9999999999);
  72. SCM(playerid,-1,"{AA3333}[GOD] {CECECE}Mostantol halhatatlan vagy!");
  73. return cmd_ucp(playerid);
  74. }
  75. else if(GetPVarInt(playerid,"GOD") == 1 )
  76. {
  77. GOD[playerid] = 0;
  78. SetPVarInt(playerid, "GOD",0);
  79. HP(playerid,100);
  80. SCM(playerid,-1,"{AA3333}[GOD] {CECECE}Mostantol sebezhető vagy!");
  81. return cmd_ucp(playerid);
  82. }
  83. }
  84. }
  85. }
  86. return 1;
  87. }
  88.  
  89. CMD:afk(playerid, params[])
  90. {
  91. if(GetPVarInt(playerid,"AFK") == 0)
  92. {
  93. AFK[playerid] = 1;
  94. TogglePlayerControllable(playerid,false);
  95. SetPVarInt(playerid,"AFK",1);
  96. format(string, sizeof(string), "{AA3333}[AFK] {CECECE}%s {AA3333}Nem Elérhető !",pName(playerid));
  97. SCMA(-1, string);
  98. }
  99. else if(GetPVarInt(playerid,"AFK") == 1 )
  100. {
  101. AFK[playerid] = 0;
  102. TogglePlayerControllable(playerid,true);
  103. SetPVarInt(playerid, "AFK",0);
  104. format(string, sizeof(string), "{AA3333}[AFK] {CECECE}%s {AA3333}Elérhető !",pName(playerid));
  105. SCMA(-1, string);
  106. }
  107. return 1;
  108. }
  109.  
  110. CMD:god(playerid, params[])
  111. {
  112. if(GetPVarInt(playerid,"GOD") == 0)
  113. {
  114. GOD[playerid] = 1;
  115. SetPVarInt(playerid,"GOD",1);
  116. HP(playerid,9999999999);
  117. SCM(playerid,-1,"{AA3333}[GOD] {CECECE}Mostantol halhatatlan vagy!");
  118. }
  119. else if(GetPVarInt(playerid,"GOD") == 1 )
  120. {
  121. GOD[playerid] = 0;
  122. SetPVarInt(playerid, "GOD",0);
  123. HP(playerid,100);
  124. SCM(playerid,-1,"{AA3333}[GOD] {CECECE}Mostantol sebezhető vagy!");
  125. }
  126. return 1;
  127. }
  128.  
  129. stock pName(playerid) { new n[24]; GetPlayerName(playerid, n, 24);return n;}
  130.  
  131. //UCP By : MLP]LoFoLi.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement