Advertisement
GordonBeard

SourceMod: MvM Wave Report

Mar 20th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. // 1. I do not know if there is a better way to do this
  5. // 2. I do not care, this works.
  6. // 3. If there is a better way to do this, please steal this code and make it better becuase:
  7. // 4. I do not care.
  8. // Usage: in console type "sm_mvmround" and it will spit out the current wave and the max waves.
  9.  
  10. new const String:PLUGIN_VERSION[] = "1";
  11.  
  12. public Plugin:myinfo =
  13. {
  14. name = "MvM Round Reporter",
  15. author = "doc",
  16. description = "Returns the current and total waves for the current MvM game.",
  17. version = PLUGIN_VERSION,
  18. url = "http://cafeofbrokendreams.com"
  19. };
  20.  
  21. public OnPluginStart ()
  22. {
  23. CreateConVar("sm_mvmround_version", PLUGIN_VERSION, "Version of MvM Round Reporter", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  24. RegConsoleCmd("sm_mvmround", Command_MVMRound)
  25. }
  26.  
  27. public Action:Command_MVMRound(client, args)
  28. {
  29. if (!GameRules_GetProp("m_bPlayingMannVsMachine"))
  30. {
  31. return Plugin_Handled;
  32. }
  33. new ent, round, maxrnd
  34.  
  35. ent = FindEntityByClassname(-1, "tf_objective_resource");
  36. round = GetEntProp(ent, Prop_Send, "m_nMannVsMachineWaveCount");
  37. maxrnd = GetEntProp(ent, Prop_Send, "m_nMannVsMachineMaxWaveCount");
  38.  
  39. ReplyToCommand(client, "%i/%i", round, maxrnd);
  40.  
  41. return Plugin_Handled;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement