Advertisement
GamerRO

Untitled

Aug 29th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.73 KB | None | 0 0
  1. https://prntscr.com/g4gmvk
  2.  
  3.  
  4. #include <sourcemod>
  5. #include <sdktools>
  6. #include <sdkhooks>
  7. #include <cstrike>
  8. #include <captain>
  9. #include <lastrequest>
  10. #include <franug_jb>
  11.  
  12. new Handle:cvar_ff;
  13.  
  14. public OnPluginStart()
  15. {
  16. RegConsoleCmd("sm_menu", DOMenu);
  17. RegConsoleCmd("buyammo2", DOMenu);
  18.  
  19. RegConsoleCmd("sm_simonmenu", DOsimon);
  20.  
  21. cvar_ff = FindConVar("mp_teammates_are_enemies");
  22. }
  23.  
  24. public Action:DOMenu(client,args)
  25. {
  26. new Handle:menu = CreateMenu(DIDMenuHandler);
  27. SetMenuTitle(menu, "JBGO.DIPCRAFT");
  28. if(JC_GetCaptain() == client) AddMenuItem(menu, "simonmenu", "Simon Menu");
  29. else if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "sersimon", "Fi Simon");
  30. /* if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "tt", "Ser preso");
  31. else if(GetClientTeam(client) == CS_TEAM_T) AddMenuItem(menu, "ct", "Ser guardia (Micro requerido)"); */
  32.  
  33. if(GetClientTeam(client) == CS_TEAM_CT) AddMenuItem(menu, "guns", "Choose weapons");
  34. AddMenuItem(menu, "tienda", "Shop");
  35.  
  36. //AddMenuItem(menu, "hats", "Hats Menu");
  37. //AddMenuItem(menu, "normas", "Leer normas");
  38. AddMenuItem(menu, "admin", "Menu de Administrador");
  39. SetMenuExitButton(menu, true);
  40. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  41. }
  42.  
  43. public DIDMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
  44. {
  45. if ( action == MenuAction_Select )
  46. {
  47. new String:info[32];
  48.  
  49. GetMenuItem(menu, itemNum, info, sizeof(info));
  50.  
  51. /* if ( strcmp(info,"tt") == 0 )
  52. {
  53. ClientCommand(client, "jointeam %i", CS_TEAM_T);
  54. DOMenu(client,0);
  55. }
  56. else if ( strcmp(info,"ct") == 0 )
  57. {
  58. ClientCommand(client, "jointeam %i", CS_TEAM_CT);
  59. DOMenu(client,0);
  60. } */
  61. if ( strcmp(info,"guns") == 0 )
  62. {
  63. FakeClientCommand(client, "say !guns");
  64. }
  65. else if ( strcmp(info,"tienda") == 0 )
  66. {
  67. FakeClientCommand(client, "sm_awards");
  68. }
  69. else if ( strcmp(info,"hats") == 0 )
  70. {
  71. FakeClientCommand(client, "sm_hats");
  72. }
  73. else if ( strcmp(info,"normas") == 0 )
  74. {
  75. FakeClientCommand(client, "sm_rules");
  76. //DOMenu(client,0);
  77. }
  78. else if ( strcmp(info,"admin") == 0 )
  79. {
  80. FakeClientCommand(client, "sm_admin");
  81. }
  82. else if ( strcmp(info,"simonmenu") == 0 )
  83. {
  84. FakeClientCommand(client, "sm_simonmenu");
  85. }
  86. else if ( strcmp(info,"sersimon") == 0 )
  87. {
  88. DOMenu(client,0);
  89. FakeClientCommand(client, "sm_simon");
  90.  
  91. }
  92.  
  93. }
  94. else if (action == MenuAction_End)
  95. {
  96. CloseHandle(menu);
  97. }
  98. }
  99.  
  100. public Action:DOsimon(client,args)
  101. {
  102. new Handle:menu = CreateMenu(DIDMenuHandlerS);
  103. SetMenuTitle(menu, "Simon menu");
  104.  
  105. AddMenuItem(menu, "abrir", "Open jail doors");
  106. AddMenuItem(menu, "cerrar", "Close jail doors");
  107. AddMenuItem(menu, "fdall", "Give FreeDay to all");
  108. AddMenuItem(menu, "fdone", "Give FreeDay to a player");
  109. AddMenuItem(menu, "kill", "Kill a random Ts");
  110.  
  111. if(!GetConVarBool(cvar_ff)) AddMenuItem(menu, "ffa1", "Enable friendly fire to Ts");
  112. else AddMenuItem(menu, "ffa2", "Disable friendly fire to Ts");
  113.  
  114. AddMenuItem(menu, "nosimon", "Leave Simon");
  115. SetMenuExitButton(menu, true);
  116. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  117. }
  118.  
  119. public DIDMenuHandlerS(Handle:menu, MenuAction:action, client, itemNum)
  120. {
  121. if ( action == MenuAction_Select )
  122. {
  123. if(JC_GetCaptain() != client) return;
  124.  
  125. new String:info[32];
  126.  
  127. GetMenuItem(menu, itemNum, info, sizeof(info));
  128.  
  129. if ( strcmp(info,"abrir") == 0 )
  130. {
  131. FakeClientCommand(client, "sm_open");
  132. DOsimon(client,0);
  133. }
  134. else if ( strcmp(info,"cerrar") == 0 )
  135. {
  136. FakeClientCommand(client, "sm_close");
  137. DOsimon(client,0);
  138. }
  139. else if ( strcmp(info,"fdall") == 0 )
  140. {
  141. FDTodos();
  142. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon given FreeDay to all!");
  143. DOsimon(client,0);
  144. }
  145. else if ( strcmp(info,"fdone") == 0 )
  146. {
  147. FDone(client);
  148. }
  149. else if ( strcmp(info,"ffa1") == 0 )
  150. {
  151. SetCvar("mp_teammates_are_enemies", 1);
  152. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon enabled the friendly fire to Ts!");
  153.  
  154. DOsimon(client,0);
  155. }
  156. else if ( strcmp(info,"ffa2") == 0 )
  157. {
  158. SetCvar("mp_teammates_are_enemies", 0);
  159. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon Disabled the friendly fire to Ts!");
  160.  
  161. DOsimon(client,0);
  162. }
  163. else if ( strcmp(info,"kill") == 0 )
  164. {
  165. new ale = GetRandomPlayer(CS_TEAM_T);
  166. if(ale > 0)
  167. {
  168. ForcePlayerSuicide(ale);
  169. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon killed randomly to %N", ale);
  170.  
  171. }
  172. DOsimon(client,0);
  173. }
  174. else if ( strcmp(info,"nosimon") == 0 )
  175. {
  176. FakeClientCommand(client, "sm_nosimon");
  177. DOMenu(client,0);
  178. }
  179.  
  180. }
  181. else if (action == MenuAction_End)
  182. {
  183. CloseHandle(menu);
  184. }
  185. }
  186.  
  187. public SetCvar(String:cvarName[64], value)
  188. {
  189. new Handle:cvar;
  190. cvar = FindConVar(cvarName);
  191.  
  192. new flags = GetConVarFlags(cvar);
  193. flags &= ~FCVAR_NOTIFY;
  194. SetConVarFlags(cvar, flags);
  195.  
  196. SetConVarInt(cvar, value);
  197.  
  198. flags |= FCVAR_NOTIFY;
  199. SetConVarFlags(cvar, flags);
  200. }
  201.  
  202. FDTodos()
  203. {
  204. for (new i = 1; i < MaxClients; i++)
  205. if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
  206. JB_GiveFD(i);
  207. }
  208.  
  209. FDone(client)
  210. {
  211. new Handle:menu = CreateMenu(DIDMenuHandlerFD);
  212. SetMenuTitle(menu, "Choose player to give FreeDay");
  213.  
  214. decl String:temp2[8], String:temp[128];
  215. new cuenta = 0;
  216. for (new i = 1; i < MaxClients; i++)
  217. if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T && !JB_GetFD(i))
  218. {
  219. Format(temp, 128, "%N", i);
  220. Format(temp2, 8, "%i", i);
  221. AddMenuItem(menu, temp2, temp);
  222.  
  223. cuenta++;
  224. }
  225.  
  226. SetMenuExitButton(menu, true);
  227. DisplayMenu(menu, client, MENU_TIME_FOREVER);
  228.  
  229. if(cuenta == 0)
  230. {
  231. PrintToChat(client, " \x04[Franug-JailBreak] \x05No players for give FreeDay");
  232. DOsimon(client,0);
  233. }
  234. }
  235.  
  236. public DIDMenuHandlerFD(Handle:menu, MenuAction:action, client, itemNum)
  237. {
  238. if ( action == MenuAction_Select )
  239. {
  240. if(JC_GetCaptain() != client) return;
  241.  
  242. new String:info[32];
  243.  
  244. GetMenuItem(menu, itemNum, info, sizeof(info));
  245.  
  246. new i = StringToInt(info);
  247. if(IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_T)
  248. {
  249. JB_GiveFD(i);
  250. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon Given FreeDay to %N", i);
  251.  
  252. DOsimon(client,0);
  253. }
  254. else
  255. {
  256. PrintToChat(client, " \x04[Franug-JailBreak] \x05Target invalid. Choose other player");
  257. FDone(client);
  258. }
  259.  
  260. }
  261. else if (action == MenuAction_End)
  262. {
  263. CloseHandle(menu);
  264. }
  265. }
  266.  
  267. GetRandomPlayer(team)
  268. {
  269. new clients[MaxClients+1], clientCount;
  270. for (new i = 1; i <= MaxClients; i++)
  271. if (IsClientInGame(i) && GetClientTeam(i) == team) clients[clientCount++] = i;
  272.  
  273. return (clientCount == 0) ? -1 : clients[GetRandomInt(0, clientCount-1)];
  274. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement