Advertisement
Guest User

Untitled

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