hlmod.hu
https://hlmod.hu/

LILA nézo lista
https://hlmod.hu/viewtopic.php?f=46&t=11550
Oldal: 1 / 1

Szerző:  Milkywaye [ 2013.11.02. 16:10 ]
Hozzászólás témája:  LILA nézo lista

Szijasztok! Van ojan nézo lista plugin hogy lilával mutasa ha igen kulgyetek :)

Szerző:  kiki [ 2013.11.02. 16:25 ]
Hozzászólás témája:  Re: LILA nézo lista

Milyen játékhoz. Sourcemodba van néző lista?

Szerző:  Arkshine [ 2013.11.02. 16:46 ]
Hozzászólás témája:  Re: LILA nézo lista

Elvileg létező plugin, igen! Láttam egy szerveren, aminek nem írom le a nevét, mert hirdetés.



kiki írta:
Milyen játékhoz. Sourcemodba van néző lista?

Szerző:  CrB [ 2013.11.02. 18:02 ]
Hozzászólás témája:  Re: LILA nézo lista

maga a plugin ittvan: https://forums.alliedmods.net/showthread.php?p=1271439

telón vagyok szal nemtudom megnyitni a forráskódot

Szerző:  jamil1986 [ 2013.11.02. 18:59 ]
Hozzászólás témája:  Re: LILA nézo lista

Itt a forrása:

SMX Forráskód: [ Mindet kijelol ]
  1.  
  2. #pragma semicolon 1
  3.  
  4. #include <sourcemod>
  5.  
  6. #define SPECMODE_NONE 0
  7. #define SPECMODE_FIRSTPERSON 4
  8. #define SPECMODE_3RDPERSON 5
  9. #define SPECMODE_FREELOOK 6
  10.  
  11. #define UPDATE_INTERVAL 1.0
  12. #define PLUGIN_VERSION "1.1.2"
  13.  
  14. new Handle:HudHintTimers[MAXPLAYERS+1];
  15. new Handle:sm_speclist_enabled;
  16. new Handle:sm_speclist_allowed;
  17. new Handle:sm_speclist_adminonly;
  18. new bool:g_Enabled;
  19. new bool:g_AdminOnly;
  20.  
  21. public Plugin:myinfo =
  22. {
  23. name = "Spectator List",
  24. author = "GoD-Tony",
  25. description = "View who is spectating you in CS:S",
  26. version = PLUGIN_VERSION,
  27. url = "http://www.sourcemod.net/"
  28. };
  29.  
  30. public OnPluginStart()
  31. {
  32. CreateConVar("sm_speclist_version", PLUGIN_VERSION, "Spectator List Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
  33. sm_speclist_enabled = CreateConVar("sm_speclist_enabled","1","Enables the spectator list for all players by default.");
  34. sm_speclist_allowed = CreateConVar("sm_speclist_allowed","1","Allows players to enable spectator list manually when disabled by default.");
  35. sm_speclist_adminonly = CreateConVar("sm_speclist_adminonly","0","Only admins can use the features of this plugin.");
  36.  
  37. RegConsoleCmd("sm_speclist", Command_SpecList);
  38.  
  39. HookConVarChange(sm_speclist_enabled, OnConVarChange);
  40. HookConVarChange(sm_speclist_adminonly, OnConVarChange);
  41.  
  42. g_Enabled = GetConVarBool(sm_speclist_enabled);
  43. g_AdminOnly = GetConVarBool(sm_speclist_adminonly);
  44.  
  45. AutoExecConfig(true, "plugin.speclist");
  46. }
  47.  
  48. public OnConVarChange(Handle:hCvar, const String:oldValue[], const String:newValue[])
  49. {
  50. if (hCvar == sm_speclist_enabled)
  51. {
  52. g_Enabled = GetConVarBool(sm_speclist_enabled);
  53.  
  54. if (g_Enabled)
  55. {
  56. // Enable timers on all players in game.
  57. for(new i = 1; i <= MaxClients; i++)
  58. {
  59. if (!IsClientInGame(i))
  60. continue;
  61.  
  62. CreateHudHintTimer(i);
  63. }
  64. }
  65. else
  66. {
  67. // Kill all of the active timers.
  68. for(new i = 1; i <= MaxClients; i++)
  69. KillHudHintTimer(i);
  70. }
  71. }
  72. else if (hCvar == sm_speclist_adminonly)
  73. {
  74. g_AdminOnly = GetConVarBool(sm_speclist_adminonly);
  75.  
  76. if (g_AdminOnly)
  77. {
  78. // Kill all of the active timers.
  79. for(new i = 1; i <= MaxClients; i++)
  80. KillHudHintTimer(i);
  81.  
  82. // Enable timers on all admins in game.
  83. for(new i = 1; i <= MaxClients; i++)
  84. {
  85. if (!IsClientInGame(i))
  86. continue;
  87.  
  88. CreateHudHintTimer(i);
  89. }
  90. }
  91. }
  92. }
  93.  
  94. public OnClientPostAdminCheck(client)
  95. {
  96. if (g_Enabled)
  97. CreateHudHintTimer(client);
  98. }
  99.  
  100. public OnClientDisconnect(client)
  101. {
  102. KillHudHintTimer(client);
  103. }
  104.  
  105. // Using 'sm_speclist' to toggle the spectator list per player.
  106. public Action:Command_SpecList(client, args)
  107. {
  108. if (HudHintTimers[client] != INVALID_HANDLE)
  109. {
  110. KillHudHintTimer(client);
  111. ReplyToCommand(client, "[SM] Spectator list disabled.");
  112. }
  113. else if (g_Enabled || GetConVarBool(sm_speclist_allowed))
  114. {
  115. CreateHudHintTimer(client);
  116. ReplyToCommand(client, "[SM] Spectator list enabled.");
  117. }
  118.  
  119. return Plugin_Handled;
  120. }
  121.  
  122.  
  123. public Action:Timer_UpdateHudHint(Handle:timer, any:client)
  124. {
  125. new iSpecModeUser = GetEntProp(client, Prop_Send, "m_iObserverMode");
  126. new iSpecMode, iTarget, iTargetUser;
  127. new bool:bDisplayHint = false;
  128.  
  129. decl String:szText[254];
  130. szText[0] = '\0';
  131.  
  132. // Dealing with a client who is in the game and playing.
  133. if (IsPlayerAlive(client))
  134. {
  135. for(new i = 1; i <= MaxClients; i++)
  136. {
  137. if (!IsClientInGame(i) || !IsClientObserver(i))
  138. continue;
  139.  
  140. iSpecMode = GetEntProp(i, Prop_Send, "m_iObserverMode");
  141.  
  142. // The client isn't spectating any one person, so ignore them.
  143. if (iSpecMode != SPECMODE_FIRSTPERSON && iSpecMode != SPECMODE_3RDPERSON)
  144. continue;
  145.  
  146. // Find out who the client is spectating.
  147. iTarget = GetEntPropEnt(i, Prop_Send, "m_hObserverTarget");
  148.  
  149. // Are they spectating our player?
  150. if (iTarget == client)
  151. {
  152. Format(szText, sizeof(szText), "%s%N\n", szText, i);
  153. bDisplayHint = true;
  154. }
  155. }
  156. }
  157. else if (iSpecModeUser == SPECMODE_FIRSTPERSON || iSpecModeUser == SPECMODE_3RDPERSON)
  158. {
  159. // Find out who the User is spectating.
  160. iTargetUser = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
  161.  
  162. if (iTargetUser > 0)
  163. Format(szText, sizeof(szText), "Spectating %N:\n", iTargetUser);
  164.  
  165. for(new i = 1; i <= MaxClients; i++)
  166. {
  167. if (!IsClientInGame(i) || !IsClientObserver(i))
  168. continue;
  169.  
  170. iSpecMode = GetEntProp(i, Prop_Send, "m_iObserverMode");
  171.  
  172. // The client isn't spectating any one person, so ignore them.
  173. if (iSpecMode != SPECMODE_FIRSTPERSON && iSpecMode != SPECMODE_3RDPERSON)
  174. continue;
  175.  
  176. // Find out who the client is spectating.
  177. iTarget = GetEntPropEnt(i, Prop_Send, "m_hObserverTarget");
  178.  
  179. // Are they spectating the same player as User?
  180. if (iTarget == iTargetUser)
  181. Format(szText, sizeof(szText), "%s%N\n", szText, i);
  182. }
  183. }
  184.  
  185. /* We do this to prevent displaying a message
  186. to a player if no one is spectating them anyway. */
  187. if (bDisplayHint)
  188. {
  189. Format(szText, sizeof(szText), "Spectating %N:\n%s", client, szText);
  190. bDisplayHint = false;
  191. }
  192.  
  193. // Send our message
  194. new Handle:hBuffer = StartMessageOne("KeyHintText", client);
  195. BfWriteByte(hBuffer, 1);
  196. BfWriteString(hBuffer, szText);
  197. EndMessage();
  198.  
  199. return Plugin_Continue;
  200. }
  201.  
  202. CreateHudHintTimer(client)
  203. {
  204. // If AdminOnly is enabled, make sure we only create timers on admins.
  205. new AdminId:admin = GetUserAdmin(client);
  206.  
  207. if (!g_AdminOnly || (g_AdminOnly && GetAdminFlag(admin, Admin_Generic, Access_Effective)))
  208. HudHintTimers[client] = CreateTimer(UPDATE_INTERVAL, Timer_UpdateHudHint, client, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
  209. }
  210.  
  211. KillHudHintTimer(client)
  212. {
  213. if (HudHintTimers[client] != INVALID_HANDLE)
  214. {
  215. KillTimer(HudHintTimers[client]);
  216. HudHintTimers[client] = INVALID_HANDLE;
  217. }
  218. }



Hozzáteszem ebbe nem lehet színt állítani, vagyis ha csshez kell, ugyanis cssben nem lehet hudot használni.

Szerző:  RaZzoR [ 2013.11.02. 19:10 ]
Hozzászólás témája:  Re: LILA nézo lista

Biztos h nem lehet.. HudÜzenetek

Szerző:  kiki [ 2013.11.02. 19:12 ]
Hozzászólás témája:  Re: LILA nézo lista

RaZzoR írta:
Biztos h nem lehet.. HudÜzenetek


Igen, ahogy mondod. Sajna cssben tényleg nemlehet, bár az nem azt jelenti hogy sourcemodban nem lehet. Teamfortess 2őn megy tökéletesen.

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/