****** ** spawns in FFA with 18 slots
#11
here's an example of how you can add a random spawn
Code:
string map = ""; public override void OnMapChange() { map = GetDvar("mapname"); } public override void OnPlayerSpawned(ServerClient Client) { Random rnd = new Random(); int spawn; spawn = rnd.Next(0, 3); if (map == "mp_dome") // the map you want { if (spawn == 1) { Client.OriginX = 100f; //Change the location to whatever you want Client.OriginY = 100f; Client.OriginZ = 100f; } if (spawn == 2) { Client.OriginX = 200f; //Change the location to whatever you want Client.OriginY = 200f; Client.OriginZ = 200f; } //etc. } }
Reply

#12
(02-11-2013, 21:15)8q4s8 Wrote: here's an example of how you can add a random spawn
Code:
...
Now where do I get the coordinates and what do I have to do with the code?
Reply

#13
(02-11-2013, 21:15)8q4s8 Wrote: here's an example of how you can add a random spawn
Code:
string map = ""; public override void OnMapChange() { map = GetDvar("mapname"); } public override void OnPlayerSpawned(ServerClient Client) { Random rnd = new Random(); int spawn; spawn = rnd.Next(0, 3); if (map == "mp_dome") // the map you want { if (spawn == 1) { Client.OriginX = 100f; //Change the location to whatever you want Client.OriginY = 100f; Client.OriginZ = 100f; } if (spawn == 2) { Client.OriginX = 200f; //Change the location to whatever you want Client.OriginY = 200f; Client.OriginZ = 200f; } //etc. } }

It's bad code, what about if enemy camping next to your spawn? Need to do some protection or "smart" spawn system. I think it's easy ( maybe ).
Like create dictionaries or whatever, add positions, make foreach from all clients and if (distance(client.pos, spawnpos) < 200) => Find another spawn spot?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#14
I know but i thought i give him a code so he got an idea how he could make it. Also tacs won't work with that
Reply

#15
(02-12-2013, 19:25)8q4s8 Wrote: I know but i thought i give him a code so he got an idea how he could make it. Also tacs won't work with that

It will work.
Maybe i'll write plugin for this. ( tomorrow Troll )
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#16
(02-12-2013, 19:26)SailorMoon Wrote: It will work.
Maybe i'll write plugin for this. ( tomorrow Troll )
Any news?
Reply

#17
@sailormoon If you are, make sure to check there are no other (enemy) clients within a radius of 10 meter.
Reply

#18
(02-15-2013, 08:50)JariZ Wrote: @sailormoon If you are, make sure to check there are no other (enemy) clients within a radius of 10 meter.

I know it already, i'll try to make this plugin now.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#19
(02-15-2013, 11:25)SailorMoon Wrote: I know it already, i'll try to make this plugin now.
Any news on this?
Reply

#20
(03-04-2013, 22:38)napok Wrote:
(02-15-2013, 11:25)SailorMoon Wrote: I know it already, i'll try to make this plugin now.
Any news on this?

It is already released LOL

http://www.itsmods.com/forum/Thread-Rele...pawns.html
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Brick [Release] [CODE] Custom spawns Nekochan 22 16,526 03-22-2013, 18:15
Last Post: napok
  [Request] Player slots plugin alex2477 6 5,507 02-25-2013, 13:33
Last Post: JariZ
  Turoial please, how do you add death machine to your slots? Erik The Born 9 7,288 02-15-2013, 21:38
Last Post: Gladio
  reserved slots setman 8 5,740 05-31-2012, 11:34
Last Post: Yamato
  Help Please...(Player slots) alex2477 2 2,938 04-11-2012, 15:33
Last Post: alex2477
  [Request] More Slots movinggun 2 3,049 03-06-2012, 10:12
Last Post: milchshake
  [Request] reserved slots movinggun 7 5,760 03-05-2012, 01:10
Last Post: milchshake
  50 Slots-Goodtimes-Faction PVP-MobArena-Gates-Whitelist-1.0 Stuffing 9 6,109 03-01-2012, 21:52
Last Post: xbedestroyed
  [Tutorial] Giving your server extra slots for free. koil 19 11,287 07-30-2011, 22:59
Last Post: koil

Forum Jump:


Users browsing this thread:
1 Guest(s)

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