HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  
  2. #include <sourcemod>
  3. #include <cstrike>
  4. #include <sdktools>
  5. #include <sdkhooks>
  6.  
  7. #define VERSION "v1.1"
  8.  
  9. new Handle:sm_soccermod_enable;
  10.  
  11. public Plugin:myinfo =
  12. {
  13. name = "SM SoccerMod",
  14. author = "Franc1sco Steam: franug",
  15. description = "Mod of Soccer for CS:S",
  16. version = VERSION,
  17. url = "http://servers-cfg.foroactivo.com/"
  18. }
  19.  
  20. public OnPluginStart()
  21. {
  22. CreateConVar("sm_SoccerMod", VERSION, "Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
  23.  
  24. sm_soccermod_enable = CreateConVar("sm_soccermod_enable", "1", "Enables/disables all features of the plugin.", FCVAR_NONE, true, 0.0, true, 1.0);
  25.  
  26. HookEvent("round_start", Ronda_Empieza);
  27.  
  28. HookEvent("player_spawn", Event_PlayerSpawn);
  29.  
  30.  
  31. }
  32.  
  33. public OnMapStart()
  34. {
  35. if (GetConVarInt(sm_soccermod_enable) == 1)
  36. {
  37. AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/home2/skin_foot_a2.vmt");
  38. AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/home2/skin_foot_a2.vtf");
  39. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.dx80.vtx");
  40. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.dx90.vtx");
  41. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  42. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.phy");
  43. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.sw.vtx");
  44. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.vvd");
  45. AddFileToDownloadsTable("models/player/soccermod/termi/2010/home2/ct_urban.xbox.vtx");
  46. AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/away2/skin_foot_a2.vmt");
  47. AddFileToDownloadsTable("materials/models/player/soccermod/termi/2010/away2/skin_foot_a2.vtf");
  48. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.dx80.vtx");
  49. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.dx90.vtx");
  50. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
  51. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.phy");
  52. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.sw.vtx");
  53. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.vvd");
  54. AddFileToDownloadsTable("models/player/soccermod/termi/2010/away2/ct_urban.xbox.vtx");
  55.  
  56. //PrecacheModel("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
  57. //PrecacheModel("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  58. }
  59. PrecacheModel("models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  60. PrecacheModel("models/player/soccermod/termi/2010/away2/ct_urban.mdl");
  61. }
  62.  
  63. public OnClientPutInServer(client)
  64. {
  65. SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
  66. }
  67.  
  68. public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  69. {
  70. if (GetConVarInt(sm_soccermod_enable) == 1)
  71. {
  72. new userid = GetEventInt(event, "userid");
  73. new client = GetClientOfUserId(userid);
  74.  
  75. if (GetClientTeam(client) == CS_TEAM_T)
  76. {
  77. SetEntityModel(client,"models/player/soccermod/termi/2010/home2/ct_urban.mdl");
  78. SetEntityHealth(client, 250);
  79. }
  80. else if (GetClientTeam(client) == CS_TEAM_CT)
  81. {
  82. SetEntityModel(client,"models/player/soccermod/termi/2010/away2/ct_urban.mdl");
  83. SetEntityHealth(client, 250);
  84. }
  85. }
  86. }
  87.  
  88. public Action:Ronda_Empieza(Handle:event,const String:name[],bool:dontBroadcast)
  89. {
  90. if (GetConVarInt(sm_soccermod_enable) == 1)
  91. {
  92. ServerCommand("phys_pushscale 900");
  93. ServerCommand("phys_timescale 1");
  94. ServerCommand("sv_turbophysics 0");
  95. }
  96. }
  97.  
  98. public Action:OnTakeDamage(client, &attacker, &inflictor, &Float:damage, &damagetype)
  99. {
  100. if (GetConVarInt(sm_soccermod_enable) == 1)
  101. {
  102. if (damagetype & DMG_FALL || damagetype & DMG_BULLET || damagetype & DMG_SLASH)
  103. {
  104. return Plugin_Handled;
  105. }
  106. else if (damagetype & DMG_CRUSH)
  107. {
  108. damage = 0.0;
  109. return Plugin_Changed;
  110. }
  111. }
  112. return Plugin_Continue;
  113. }