Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <cstrike>
  5. #include <amxmisc>
  6. #include <engine>
  7. #include <fakemeta>
  8. #include <fakemeta_util>
  9. #include <fun>
  10. #include <colorchat>
  11.  
  12. #define MAX_ACCESS 5
  13. #define OWNER_ACCESS ADMIN_IMMUNITY
  14.  
  15. #define PLUGIN "Open/close/Admin/ct"
  16. #define VERSION "1.0"
  17. #define AUTHOR "NeRoX"
  18.  
  19.  
  20.  
  21. public plugin_init()
  22. {
  23.  
  24. register_plugin(PLUGIN, VERSION, AUTHOR)
  25. register_clcmd( "say /open", "Opencages" )
  26. register_clcmd( "say /close", "Closecages" )
  27.  
  28.  
  29. }
  30.  
  31.  
  32. public Opencages( client )
  33. {
  34. if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
  35. {
  36.  
  37. client_print(client, print_chat, "You opened the cells as ct temp message")
  38. //ColorChat( 0, "^x03Guard^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
  39.  
  40. new ent = -1
  41. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  42. dllfunc( DLLFunc_Use, ent, 0 );
  43. ent = -1
  44. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  45. dllfunc( DLLFunc_Use, ent, 0 );
  46.  
  47. }
  48. else if( !(get_user_flags( client ) & OWNER_ACCESS) && is_user_connected(client))
  49. {
  50. client_print(client, print_chat, "You opened the cells as admin temp message")
  51. //ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
  52. new ent = -1
  53. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  54. dllfunc( DLLFunc_Use, ent, 0 );
  55. ent = -1
  56. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  57. dllfunc( DLLFunc_Use, ent, 0 );
  58.  
  59. }
  60. else
  61. {
  62.  
  63. client_print(client, print_chat, "You dont have access to this command temp message")
  64. //ColorChat( 0, "^x03We^x01:^x04 %s^x01 Are^x03 Sorry^x01 You dont have access to this command.", GetUserName( client ) );
  65. }
  66. }
  67.  
  68. public Closecages( client )
  69. {
  70. if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
  71.  
  72. {
  73. //ColorChat( 0, "^x03Guard^x01:^x04 %s^x01 has^x03 closed^x01 the cages.", GetUserName( client ) );
  74.  
  75. new ent = -1
  76.  
  77. while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
  78. dllfunc( DLLFunc_Think, ent, 0 );
  79.  
  80. ent = -1
  81.  
  82. while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
  83. dllfunc( DLLFunc_Think, ent, 0 );
  84.  
  85.  
  86.  
  87. }
  88.  
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement