HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2.  
  3. #define HIDE_RADAR_CSGO 1<<12
  4.  
  5. new String:strGame[10];
  6.  
  7. public Plugin:myinfo =
  8. {
  9. name = "Radar Kikapcsolas",
  10. author = "Internet Bully",
  11. description = "Radar kikapcsolasa spawnolaskor",
  12. version = "1.2",
  13. url = "http://www.sourcemod.net/"
  14. }
  15.  
  16. public OnPluginStart()
  17. {
  18. HookEvent("player_spawn", Player_Spawn);
  19.  
  20. GetGameFolderName(strGame, sizeof(strGame));
  21.  
  22. if(StrContains(strGame, "cstrike") != -1)
  23. HookEvent("player_blind", Event_PlayerBlind, EventHookMode_Post);
  24. }
  25. public Player_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
  26. {
  27. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  28. CreateTimer(0.0, RemoveRadar, client);
  29. }
  30.  
  31. public Action:RemoveRadar(Handle:timer, any:client)
  32. {
  33. if(StrContains(strGame, "csgo") != -1) SetEntProp(client, Prop_Send, "m_iHideHUD", GetEntProp(client, Prop_Send, "m_iHideHUD") | HIDE_RADAR_CSGO);
  34. else if(StrContains(strGame, "cstrike") != -1)
  35. CSSHideRadar(client);
  36. }
  37.  
  38. public Event_PlayerBlind(Handle:event, const String:name[], bool:dontBroadcast) // from GoD-Tony's "Radar Config" https://forums.alliedmods.net/showthread.php?p=1471473
  39. {
  40. new userid = GetEventInt(event, "userid");
  41. new client = GetClientOfUserId(userid);
  42.  
  43. if (client && GetClientTeam(client) > 1)
  44. {
  45. new Float:fDuration = GetEntPropFloat(client, Prop_Send, "m_flFlashDuration");
  46. CreateTimer(fDuration, RemoveRadar, client);
  47. }
  48. }
  49.  
  50. CSSHideRadar(client)
  51. {
  52. SetEntPropFloat(client, Prop_Send, "m_flFlashDuration", 3600.0);
  53. SetEntPropFloat(client, Prop_Send, "m_flFlashMaxAlpha", 0.5);
  54. }