Help timer/message for flags
#11
So the flag will be displayed for that? and he would be teleported or killed?
Reply

#12
he would be tp to a death barrier, hence the warning.

i currently use 2 flag .dll, flag.dll and killflag.dll

one is for normal flag tp from a-b
second is for so called god houses, and or undermap areas, where if the flag is triggered they will be currently just tp to a death barrier. (for which i have increased the distance to the flag for activation)
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#13
Use Kill Zone, like this:

Code:
using System; using System.Threading; using Addon; using System.Collections.Generic; namespace killzone { public class killzone : CPlugin { public static float Difference(float loc, float loc2) { return Math.Abs(loc - loc2); } float x; float y; int distW; int distKill; String map = ""; public override void OnMapChange() { map = GetDvar("mapname"); if (map == "mp_mogadishu") { ////Zone of Death x = 1000f; //coord X y = 2100f; // coord Y distKill = 200; // Zone of Death //// Warning Message distW = distKill + 100; } } public override void OnServerFrame() { List<ServerClient> clients; try { clients = GetClients(); if (clients != null) { foreach (ServerClient client in GetClients()) { if (client.Other.isAlive == true && client.ConnectionState != ConnectionStates.MapLoading && client.ConnectionState != ConnectionStates.Connecting && client.ConnectionState != ConnectionStates.Zombie) { if (map == "mp_mogadishu") { if ((Difference(client.OriginX, x) <= distKill) && (Difference(client.OriginY, y) <= distKill)) { KillPlayer(client.ClientNum, client.ClientNum, GetWeapon("iw5_m60jugg"), string.Empty); } if ((Difference(client.OriginX, x) <= distW) && (Difference(client.OriginY, y) <= distW)) { iPrintLnBold("^1ATTENTION! You are near to the Zone of Death!!", client); } } } } } } catch (Exception e) { ServerPrint("Error in killzone plugin: \n" + e.Message + "\n" + e.StackTrace + "\n" + e.Source + "\n" + e.InnerException + "\n" + e.HelpLink); } } } }
Reply

#14
Thanks Alex but i see that contains the dreaded Threading? is this ok now, or does it still cause server crashes?
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#15
(01-17-2013, 20:30)hillbilly Wrote: Thanks Alex but i see that contains the dreaded Threading? is this ok now, or does it still cause server crashes?

I heard somewhere if you are running windows, it crashes server.
But I don't know if this won't crash it.
I think threading is in every case bad.
BUT, I'm not sure.
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply

#16
dam, mine are running on windows bugger wanted that as well
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#17
(01-17-2013, 20:30)hillbilly Wrote: Thanks Alex but i see that contains the dreaded Threading? is this ok now, or does it still cause server crashes?

It doesn't even contain threading, I don't know why he added it
Reply

#18
(01-17-2013, 21:15)8q4s8 Wrote:
(01-17-2013, 20:30)hillbilly Wrote: Thanks Alex but i see that contains the dreaded Threading? is this ok now, or does it still cause server crashes?

It doesn't even contain threading, I don't know why he added it



Ok nulled out threading working but the warning message scrolls at 100 miles n hr until u move back then it come up ok?
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#19
(01-17-2013, 22:00)hillbilly Wrote:
(01-17-2013, 21:15)8q4s8 Wrote:
(01-17-2013, 20:30)hillbilly Wrote: Thanks Alex but i see that contains the dreaded Threading? is this ok now, or does it still cause server crashes?

It doesn't even contain threading, I don't know why he added it



Ok nulled out threading working but the warning message scrolls at 100 miles n hr until u move back then it come up ok?

Code:
using System; using Addon; using System.Collections.Generic; using System.Text; namespace killzone { public class killzone : CPlugin { Dictionary<int, int> HudElem = new Dictionary<int, int>(); public static float Difference(float loc, float loc2) { return Math.Abs(loc - loc2); } float x; float y; int distW; int distKill; String map = ""; public override void OnMapChange() { map = GetDvar("mapname"); if (map == "mp_mogadishu") { ////Zone of Death x = 1000f; //coord X y = 2100f; // coord Y distKill = 200; // Zone of Death //// Warning Message distW = distKill + 100; } } public override void OnServerFrame() { List<ServerClient> clients; try { clients = GetClients(); if (clients != null) { foreach (ServerClient client in GetClients()) { HudElem hud = GetHudElement(HudElem[client.ClientNum]); if (client.Other.isAlive == true && client.ConnectionState != ConnectionStates.MapLoading && client.ConnectionState != ConnectionStates.Connecting && client.ConnectionState != ConnectionStates.Zombie) { if (map == "mp_mogadishu") { if ((Difference(client.OriginX, x) <= distKill) && (Difference(client.OriginY, y) <= distKill)) { KillPlayer(client.ClientNum, client.ClientNum, GetWeapon("iw5_m60jugg"), string.Empty); } if ((Difference(client.OriginX, x) <= distW) && (Difference(client.OriginY, y) <= distW)) { hud.SetString("^1ATTENTION! You are near to the Zone of Death!!"); } else { hud.SetString(""); } } } } } } catch (Exception e) { ServerPrint("Error in killzone plugin: \n" + e.Message + "\n" + e.StackTrace + "\n" + e.Source + "\n" + e.InnerException + "\n" + e.HelpLink); } } private int CreateHud(int ClientNum) { HudElem hud = CreateNewHudElem(); hud.Type = HudElementTypes.Text; hud.ShowToEnt = ClientNum; hud.HideInMenu = true; hud.Font = HudElementFonts.Default; hud.FontScale = 1.5f; hud.PointType = 120; hud.OriginY = 300f; hud.OriginX = -100f; hud.SetString(""); return hud.HudElementNum; } public override void OnPlayerDisconnect(ServerClient Client) { if (HudElem.ContainsKey(Client.ClientNum)) { HudElem hud2 = GetHudElement(HudElem[Client.ClientNum]); hud2.Type = HudElementTypes.None; HudElem.Remove(Client.ClientNum); } } public override void OnPlayerConnect(ServerClient Client) { int Hud1 = CreateHud(Client.ClientNum); if (HudElem.ContainsKey(Client.ClientNum)) HudElem[Client.ClientNum] = Hud1; else HudElem.Add(Client.ClientNum, Hud1); } } }

I added a HUD to the code because with iPrintLnBold it's just spamming the message.
You maybe have to change the location of the HUD, I didn't tested the plugin
Reply

#20
would i have to use hud again for another map
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help remove timer Dynasty 15 11,386 08-25-2013, 13:56
Last Post: hillbilly
  Help Spawn Message Playing on Respawn? Killjoy 7 7,324 07-11-2013, 14:53
Last Post: Killjoy
  [News] Message from Gabe to Steam Community d0h! 8 8,040 04-05-2013, 18:16
Last Post: SuperNovaAO
  Countdown timer pflaurie 2 3,634 03-14-2013, 11:30
Last Post: pflaurie
  Help bunkers,tex, glusses and Flags teleport funny 4 4,995 01-28-2013, 21:57
Last Post: 99IRock
  [Request] Different message per map hillbilly 6 5,326 12-22-2012, 20:55
Last Post: hillbilly
  [HELP] pm's message korsika 1 2,807 12-15-2012, 13:13
Last Post: Ich1994
  Chat Message The Tronuo 8 6,778 11-12-2012, 18:05
Last Post: Nekochan
  Health,regenerate, and message changes help mbakerinnv 4 4,903 11-02-2012, 18:12
Last Post: mbakerinnv
  S&D Welcome message only once (no repeating) islamsaab 2 3,589 10-11-2012, 18:40
Last Post: islamsaab

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.