HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <cstrike>
  2.  
  3. new Handle:g_hTimers[MAXPLAYERS+1];
  4.  
  5. public OnPluginStart()
  6. {
  7. //HookUserMessage(GetUserMessageId("VGUIMenu"), VGUIMenu, true);
  8. HookEventEx("player_connect_full", player_activate);
  9. AddCommandListener(joingame, "joingame");
  10. }
  11.  
  12. public Action:joingame(client, const String:command[], argc)
  13. {
  14. //PrintToServer("%s", command);
  15. if(g_hTimers[client] != INVALID_HANDLE)
  16. {
  17. KillTimer(g_hTimers[client]);
  18. g_hTimers[client] = INVALID_HANDLE;
  19. }
  20. }
  21.  
  22. public player_activate(Handle:event, const String:name[], bool:dontBroadcast)
  23. {
  24. //PrintToServer("player_activate = %s", name);
  25. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  26. g_hTimers[client] = CreateTimer(0.1, clearmotd, client, TIMER_REPEAT);
  27. }
  28.  
  29. public Action:clearmotd(Handle:timer, any:client)
  30. {
  31. //PrintToServer("clearmotd %i", client);
  32.  
  33. if(client == 0 || !IsClientInGame(client) || IsFakeClient(client))
  34. {
  35. g_hTimers[client] = INVALID_HANDLE;
  36. return Plugin_Stop;
  37. }
  38.  
  39. new Handle:pb = StartMessageOne("VGUIMenu", client);
  40. PbSetString(pb, "name", "info");
  41. PbSetBool(pb, "show", false);
  42.  
  43. new Handle:subkey;
  44.  
  45. subkey = PbAddMessage(pb, "subkeys");
  46. PbSetString(subkey, "name", "title");
  47. PbSetString(subkey, "str", "");
  48.  
  49. subkey = PbAddMessage(pb, "subkeys");
  50. PbSetString(subkey, "name", "type");
  51. PbSetString(subkey, "str", "0");
  52.  
  53. subkey = PbAddMessage(pb, "subkeys");
  54. PbSetString(subkey, "name", "msg");
  55. PbSetString(subkey, "str", "");
  56.  
  57. subkey = PbAddMessage(pb, "subkeys");
  58. PbSetString(subkey, "name", "cmd");
  59. PbSetString(subkey, "str", "1");
  60. EndMessage();
  61.  
  62. return Plugin_Continue;
  63.  
  64. }