• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Preview Auto tp to a location on kills
#1
Just trying to set it so on say 50 kills, player gets tp'd to a different location, any idea where i start? I already have the
if (Client.Stats.Kills == 25) etc working, just need the code to tp them on that amount of kills.

ty
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

  Reply
#2
Is it even preview?
Use dictionaries or hash, when client gets 25 kills, just update it and teleport.
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#3
(12-30-2013, 12:20)hillbilly Wrote: Just trying to set it so on say 50 kills, player gets tp'd to a different location, any idea where i start? I already have the
if (Client.Stats.Kills == 25) etc working, just need the code to tp them on that amount of kills.

ty
you mean it?
CSHARP Code
  1. using Addon;
  2. using System;
  3. using System.Collections.Generic;
  4.  
  5. namespace ClassLibrary1
  6. {
  7. public class ClassLibrary1 : CPlugin
  8. {
  9. public override void OnAddonFrame()
  10. {
  11. List<ServerClient> clients;
  12. try
  13. {
  14. clients = GetClients();
  15. if (clients != null && clients.Count > 0)
  16. {
  17. foreach (ServerClient c in GetClients())
  18. {
  19. if (c.Other.isAlive == true)
  20. {
  21. string map = GetDvar("mapname");
  22.  
  23. if (map == "mp_terminal_cls")
  24. {
  25. if (c.Stats.Kills == 50 && c.Team == Teams.Allies)
  26. {
  27. List<Vector> ListVector = new List<Vector>();
  28. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  29. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  30. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  31. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  32. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  33. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  34. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  35. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  36. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  37. ListVector.Add(new Vector(50f, 70f, 200f)); // random position
  38. Random rand = new Random();
  39. int flag = rand.Next(0, ListVector.Count);
  40. c.OriginX = ListVector[flag].X;
  41. c.OriginY = ListVector[flag].Y;
  42. c.OriginZ = ListVector[flag].Z;
  43. TellClient(c.ClientNum, string.Concat(new object[] { "^1Position Change with ^2rules" }), true);
  44.  
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. catch (Exception error)
  52. {
  53.  
  54. iPrintLnBold("^1Error View Console Log", null);
  55. ServerPrint("Error\n");
  56. ServerPrint(error.Message +"\n"+error.Source+"\n"+error.HelpLink);
  57. ServerPrint("\nError");
  58. }
  59. }
  60. }
  61. }
[-] The following 2 users say Thank You to [HARD] Tony. for this post:
  • Casper, hillbilly
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)