General > Developers Corner
Command for ulx bring all
sodak:
Hey i need a command when i type in !bringall it teleports all players to me like ulx bring * but this dont work.
Is there any quick and dirty code for this?
Bytewave:
I've considered something like this in the past, but there's a fundamental problem: How do you find positions for every player such that they aren't inside of walls, props, each other, etc?
It may be feasible, but it'd require a good bit of work. So, no, there's no "quick 'n' dirty" method of getting this done right.
Megiddo:
Bytewave, probably the easiest would be to check every ten degrees around the "bringer" at 50 units out (or whatever), then every five degrees around the "bringer" at 100 units out, then every two and a half degrees at 200 units out, etc. Using hull traces, this should work even in a tight hallway as long as you have enough free space within line-of-sight. You could give up on a full trace and just make sure there's enough room for the player at the destination, at the risk of the person being brought ending up on the other side of a wall from the person they were brought to.
JamminR:
* JamminR imagines changing PlayerArg to PlayersArg and adding a for players.getall statement in the code just to see if the Gmod map point swirls into a black hole gravity well.
Timmy:
Made a command that can bring multiple players. I had never really used vectors, angles or traces before. This was a great way to experiment with them. :)
I hope these bots brought their towels! ;D
I made sure it can handle smaller spaces.
Attached the command in addon format, in case anyone wants the code.
Usage: ulx tbring <players> [<number: 33<=x<=200, default 50>] - Teleports target(s) to you. (say: !tbring)
The second, optional, parameter can be used to control the space between each player:
Cram players in like sardines: !tbring * 33
Or, give them lots of free space: !tbring * 200
Happy halloween!
Edit: Updated command to remove an unnecessary trace.
Navigation
[0] Message Index
[#] Next page
Go to full version