Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3. #include <sdktools>
  4. #include <cstrike>
  5. #include <smartjaildoors>
  6. #include <captain>
  7.  
  8. new tiempo;
  9.  
  10. new Handle:eltimer = INVALID_HANDLE;
  11. new Handle:Cvar_Tiempo = INVALID_HANDLE;
  12.  
  13. public Plugin:myinfo =
  14. {
  15. name = "SM Doors Opener",
  16. author = "Franc1sco steam: franug",
  17. description = ".",
  18. version = "2.0",
  19. url = "http://www.clanuea.com/"
  20. };
  21.  
  22. public OnPluginStart()
  23. {
  24. RegConsoleCmd("sm_open", AbrirS);
  25. //RegConsoleCmd("sm_close", CerrarS);
  26. RegConsoleCmd("sm_close", CerrarS);
  27. //RegConsoleCmd("sm_cerrar", CerrarS);
  28. HookEvent("round_start", Event_RoundStart);
  29. Cvar_Tiempo = CreateConVar("sm_jb_doorsopenertime", "50", "Time in seconds for open doors on round start when CTs only have bots");
  30. }
  31.  
  32. public Action:Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  33. {
  34. if (eltimer != INVALID_HANDLE)
  35. KillTimer(eltimer);
  36.  
  37. eltimer = INVALID_HANDLE;
  38.  
  39.  
  40. tiempo = GetConVarInt(Cvar_Tiempo);
  41. eltimer = CreateTimer(1.0, contador, _, TIMER_REPEAT);
  42. }
  43.  
  44. public Action:contador(Handle:timer, Handle:pack)
  45. {
  46. --tiempo;
  47. if(tiempo < 1)
  48. {
  49. Abrir();
  50. PrintToChatAll(" \x04[Franug-JailBreak] \x05Jail button pressed automatically!");
  51.  
  52. if (eltimer != INVALID_HANDLE)
  53. KillTimer(eltimer);
  54.  
  55. eltimer = INVALID_HANDLE;
  56. }
  57. }
  58.  
  59. Abrir()
  60. {
  61. SJD_OpenDoors();
  62. }
  63.  
  64. public Action:AbrirS(client, args)
  65. {
  66. new capitan = JC_GetCaptain(); // get captain
  67.  
  68. if(client == capitan)
  69. {
  70. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon opened the jails doors");
  71. SJD_OpenDoors();
  72. }
  73. else
  74. PrintToChat(client, " \x04[Franug-JailBreak] \x05Need to be simon");
  75. }
  76.  
  77. public Action:CerrarS(client, args)
  78. {
  79. new capitan = JC_GetCaptain(); // get captain
  80.  
  81. if(client == capitan)
  82. {
  83. PrintToChatAll(" \x04[Franug-JailBreak] \x05Simon closed the jail doors");
  84. SJD_CloseDoors();
  85. }
  86. else
  87. PrintToChat(client, " \x04[Franug-JailBreak] \x05Need to be simon");
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement