Advertisement
Guest User

Untitled

a guest
Oct 16th, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4.  
  5. #define PLUGIN_VERSION "1.0"
  6.  
  7. public Plugin:myinfo = {
  8. name = "X",
  9. author = "X",
  10. description = "X",
  11. version = PLUGIN_VERSION
  12. };
  13.  
  14.  
  15. static Handle:timer = INVALID_HANDLE;
  16. static notification_number;
  17.  
  18.  
  19.  
  20. public OnPluginStart() {
  21. CreateConVar("round_end_slay_ver", PLUGIN_VERSION, "Round end slay version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  22. HookEvent("round_start", on_round_start);
  23. }
  24.  
  25.  
  26.  
  27. public on_round_start(Handle:event, const String:name[], bool:dontBroadcast) {
  28. if (timer != INVALID_HANDLE) // round restarted before end
  29. CloseHandle(timer);
  30. new Float:length = GetConVarFloat(FindConVar("mp_roundtime")) * 60.0 - 6.0;
  31. LogMessage("End round slay in %f seconds", length);
  32. notification_number = 5;
  33. timer = CreateTimer(length, on_round_time_end);
  34. }
  35.  
  36.  
  37.  
  38. public OnMapEnd() {
  39. if (timer != INVALID_HANDLE) {
  40. CloseHandle(timer);
  41. timer = INVALID_HANDLE;
  42. }
  43. }
  44.  
  45.  
  46.  
  47. public Action:on_round_time_end(Handle:timer_) {
  48. if (notification_number > 0) {
  49. PrintCenterTextAll("Round ending in %d seconds", notification_number);
  50. timer = CreateTimer(1.0, on_round_time_end);
  51. --notification_number;
  52. }
  53. else {
  54. timer = INVALID_HANDLE;
  55. LogMessage("Time up");
  56. for (new client=1; client<=MaxClients; ++client) {
  57. if (IsClientInGame(client) && !IsClientObserver(client) && IsPlayerAlive(client)) {
  58. for(int j = 0; j < 4; j++)
  59. {
  60. int weapon = GetPlayerWeaponSlot(client, j);
  61. if(weapon != -1)
  62. {
  63. RemovePlayerItem(client, weapon);
  64. RemoveEdict(weapon);
  65. }
  66. }
  67. }
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement