Posts: 836
Threads: 48
Joined: Feb 2012
Reputation:
11
12-30-2013, 12:20
(This post was last modified: 12-30-2013, 12:23 by hillbilly.)
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
Posts: 3,704
Threads: 147
Joined: Jan 2011
Reputation:
119
Is it even preview?
Use dictionaries or hash, when client gets 25 kills, just update it and teleport.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Posts: 245
Threads: 79
Joined: Feb 2013
12-30-2013, 15:46
(This post was last modified: 12-30-2013, 15:55 by [HARD] Tony..)
(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?
Code:
using Addon;
using System;
using System.Collections.Generic;
namespace ClassLibrary1
{
public class ClassLibrary1 : CPlugin
{
public override void OnAddonFrame()
{
List<ServerClient> clients;
try
{
clients = GetClients();
if (clients != null && clients.Count > 0)
{
foreach (ServerClient c in GetClients())
{
if (c.Other.isAlive == true)
{
string map = GetDvar("mapname");
if (map == "mp_terminal_cls")
{
if (c.Stats.Kills == 50 && c.Team == Teams.Allies)
{
List<Vector> ListVector = new List<Vector>();
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
ListVector.Add(new Vector(50f, 70f, 200f)); // random position
Random rand = new Random();
int flag = rand.Next(0, ListVector.Count);
c.OriginX = ListVector[flag].X;
c.OriginY = ListVector[flag].Y;
c.OriginZ = ListVector[flag].Z;
TellClient(c.ClientNum, string.Concat(new object[] { "^1Position Change with ^2rules" }), true);
}
}
}
}
}
}
catch (Exception error)
{
iPrintLnBold("^1Error View Console Log", null);
ServerPrint("Error\n");
ServerPrint(error.Message +"\n"+error.Source+"\n"+error.HelpLink);
ServerPrint("\nError");
}
}
}
}