Advertisement
freefiles

Untitled

Feb 28th, 2020
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. //
  2. // SourceMod Script
  3. //
  4. // Developed by <eVa>Dog
  5. // June 2008
  6. // http://www.theville.org
  7. //
  8.  
  9. //
  10. // DESCRIPTION:
  11. // For Day of Defeat Source only
  12. // This plugin is a part of the Realism Mod
  13. // but extracted for those servers wishing to run
  14. // FTB gameplay
  15.  
  16. //
  17. //
  18. // CHANGELOG:
  19. // - 06.8.2008 Version 1.0.100
  20.  
  21.  
  22. #include <sourcemod>
  23. #include <sdktools>
  24.  
  25. #define PLUGIN_VERSION "1.0.101"
  26.  
  27. #define IN 0x0001
  28. #define OUT 0x0002
  29.  
  30. new const String:g_sSteamID[][] =
  31. {
  32. /// STEAM_ID в старом формате
  33. "STEAM_0:0:434959392",
  34. "STEAM_0:0:xxxx"
  35. };
  36. // new Handle:Cvar_FtbDelay = INVALID_HANDLE
  37.  
  38. public Plugin:myinfo =
  39. {
  40. name = "DoDS Fade to Blue Attacker",
  41. author = "<eVa>Dog",
  42. description = "Personal Fade to Blue for Day of Defeat Source Private for STEAM_ID",
  43. version = PLUGIN_VERSION,
  44. url = "http://www.theville.org"
  45. }
  46.  
  47. public OnPluginStart()
  48. {
  49. CreateConVar("sm_dod_ftb_version", PLUGIN_VERSION, "Version of sm_dod_ftb", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY)
  50. // Cvar_FtbDelay = CreateConVar("sv_dod_ftb_delay", "5", " The duration of the Fade to Black screen fade", FCVAR_PLUGIN)
  51.  
  52. HookEvent("player_death", PlayerDeathEvent)
  53. }
  54.  
  55. public OnEventShutdown()
  56. {
  57. UnhookEvent("player_death", PlayerDeathEvent)
  58. }
  59.  
  60.  
  61. public PlayerDeathEvent(Handle:event, const String:name[], bool:dontBroadcast)
  62. {
  63. new client = GetClientOfUserId(GetEventInt(event, "attacker"))
  64.  
  65. // Get Player ID
  66. new String:f_sAuthID[64];
  67. GetClientAuthString(client, f_sAuthID, sizeof(f_sAuthID));
  68. for (new i; i < sizeof(g_sSteamID); ++i)
  69. {
  70. if (strcmp(g_sSteamID[i], f_sAuthID) == 0) ScreenFade(client, 0, 0, 200, 51, 300, IN);
  71. }
  72. }
  73.  
  74.  
  75. //Fade the screen
  76. public ScreenFade(client, red, green, blue, alpha, delay, type)
  77. {
  78. new Handle:msg
  79. new duration
  80.  
  81. duration = delay
  82.  
  83. msg = StartMessageOne("Fade", client)
  84. BfWriteShort(msg, duration)
  85. BfWriteShort(msg, 0)
  86. BfWriteShort(msg, type)
  87. BfWriteByte(msg, red)
  88. BfWriteByte(msg, green)
  89. BfWriteByte(msg, blue)
  90. BfWriteByte(msg, alpha)
  91. EndMessage()
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement