Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5. #include < cstrike >
  6. #include < fakemeta_util >
  7.  
  8. #define MAX_ACCESS 5
  9. #define OWNER_ACCESS ADMIN_IMMUNITY
  10.  
  11.  
  12. new Info[ 4 ][ ] = {
  13.  
  14. "JailBreak Menu open & close the cages",
  15. "1.0",
  16. "EB0Y",
  17. "AMXX" // Prefix
  18.  
  19. };
  20.  
  21. public plugin_init() {
  22.  
  23. register_plugin( Info[ 0 ], Info[ 1 ], Info[ 2 ] );
  24. register_clcmd( "say /open", "Opencages" )
  25. register_clcmd( "say /close", "Closecages" )
  26. register_clcmd( "say /openadmin", "Opencagesadmin" )
  27. register_clcmd( "say /closeadmin", "Closecagesadmin" )
  28. //register_saycmd( "cages_menu", "CmdMainMenu", 0, "Open & Close the cages menu" );
  29. }
  30.  
  31. /*public CmdMainMenu( client )
  32. {
  33. if ( !is_user_alive( client ) || ! is_user_connected( client ) )
  34. return 1;
  35.  
  36. else if ( ! access( client, OWNER_ACCESS ) )
  37. return ColorChat( client, "You have no^x04 access^x01 to this command" );
  38.  
  39. new Menu = menu_create( "\w[\rJailBreak\w]\y Open & Close the cages Menu", "MainMenuHandler" );
  40.  
  41. menu_additem( Menu, "Open the cages" );
  42.  
  43. menu_additem( Menu, "Close the cages" );
  44.  
  45. menu_setprop( Menu, MPROP_EXITNAME, "\wExit" );
  46.  
  47. menu_display( client, Menu );
  48.  
  49. return 1;
  50. }*/
  51.  
  52. public MainMenuHandler( client, Menu, Item )
  53. {
  54. if ( Item == MENU_EXIT )
  55. return menu_destroy( Menu );
  56.  
  57. switch ( Item )
  58. {
  59. case 0: Opencages( client );
  60.  
  61. case 1: Closecages( client );
  62. }
  63.  
  64. menu_display( client, Menu, 0 );
  65.  
  66. return 1;
  67. }
  68.  
  69. public Opencages( client )
  70. {
  71. if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
  72. return 1;
  73.  
  74.  
  75. ColorChat( 0, "^x03Guard^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
  76.  
  77. new ent = -1
  78.  
  79. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  80. dllfunc( DLLFunc_Use, ent, 0 );
  81.  
  82. ent = -1
  83.  
  84. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  85. dllfunc( DLLFunc_Use, ent, 0 );
  86.  
  87. return 0;
  88.  
  89. }
  90.  
  91. public Opencagesadmin( client )
  92.  
  93. {
  94. if( !(get_user_flags( client ) & OWNER_ACCESS) && is_user_connected(client))
  95. return 1;
  96.  
  97.  
  98. ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
  99.  
  100. new ent = -1
  101.  
  102. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  103. dllfunc( DLLFunc_Use, ent, 0 );
  104.  
  105. ent = -1
  106.  
  107. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  108. dllfunc( DLLFunc_Use, ent, 0 );
  109.  
  110. return 0;
  111.  
  112. }
  113.  
  114. public Closecages( client )
  115. {
  116. if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
  117. return 1;
  118.  
  119.  
  120. ColorChat( 0, "^x03Guard^x01:^x04 %s^x01 has^x03 closed^x01 the cages.", GetUserName( client ) );
  121.  
  122. new ent = -1
  123.  
  124. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  125. dllfunc( DLLFunc_Think, ent, 0 );
  126.  
  127. ent = -1
  128.  
  129. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  130. dllfunc( DLLFunc_Think, ent, 0 );
  131. return 0;
  132.  
  133. }
  134.  
  135. public Closecagesadmin( client )
  136. {
  137. if( !(get_user_flags( client ) & OWNER_ACCESS) && is_user_connected(client))
  138. return 1;
  139.  
  140.  
  141. ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 closed^x01 the cages.", GetUserName( client ) );
  142.  
  143. new ent = -1
  144.  
  145. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  146. dllfunc( DLLFunc_Think, ent, 0 );
  147.  
  148. ent = -1
  149.  
  150. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  151. dllfunc( DLLFunc_Think, ent, 0 );
  152. return 0;
  153.  
  154. }
  155.  
  156. // stock bool:is_user_can_owner( client )
  157. // {
  158. // if ( ! get_user_flags( client ) & OWNER_ACCESS )
  159. // return false;
  160.  
  161. // return true;
  162. // }
  163.  
  164. /*stock register_saycmd( iSaycommand[ ], iFunction[ ], iFlags, iInfo[ ] )
  165. {
  166. new iTypes[ ] = { "say", "say_team" };
  167. new iSigns[ ] = { "!", ".", "/" };
  168. new iTemp[ 64 ];
  169.  
  170. for ( new i = 0; i < sizeof( iTypes ); i++ )
  171. {
  172. for ( new j = 0; j < sizeof( iSigns ); j++ )
  173. {
  174. format( iTemp, charsmax( iTemp ), "%s %s%s", iTypes[ i ], iSigns[ j ], iSaycommand );
  175. register_clcmd( iTemp, iFunction, iFlags, iInfo );
  176. }
  177. }
  178. }*/
  179.  
  180. stock GetUserName( index )
  181. {
  182. static name[ 32 ];
  183.  
  184. get_user_name( index, name, charsmax( name ) );
  185.  
  186. return name;
  187. }
  188.  
  189. stock ColorChat( const id, const string[], any:... )
  190. {
  191. new msg[191], players[32], count = 1;
  192.  
  193. static len; len = formatex( msg, charsmax(msg), "^x04[JailBreak]^x01 " );
  194. vformat( msg[len], charsmax(msg) - len, string, 3 );
  195.  
  196. if(id) players[0] = id;
  197. else get_players( players,count,"ch" );
  198.  
  199. for (new i = 0; i < count; i++)
  200. {
  201. if(is_user_connected(players[i]))
  202. {
  203. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
  204. write_byte(players[i]);
  205. write_string(msg);
  206. message_end();
  207. }
  208. }
  209. return 1;
  210. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement