ID:162510
 
Ok, how can I make verb to Admins, so they could teleport player's to their position, himself to player or him or someone else to place he want's (like in 1,1,1)
Syntty wrote:
Ok, how can I make verb to Admins, so they could teleport player's to their position, himself to player or him or someone else to place he wants (like in 1,1,1)

What you want to do is change the loc of another player. The loc variable is essentially the object that another object is currently located inside (most commonly a turf), so if you want to make player A teleport to player B, then you would want to set A.loc equal to B.loc. If you want to teleport player A to location (1,1,1), then you'd need to use the locate() proc. locate() can take 3 args of the coordinates of the map. It'll return the turf in that location, so you can set player A's loc to that value that locate() returns. Therefore, to teleport player A to loc (1, 1, 1), you'd set A.loc equal to locate(1,1,1).

If you want this verb only accessible for admins, then you will have to define a verb of a different path to prevent regular players from having access to it. You'll have to manually add this verb to the verb list if the player is an admin.

Here's a small code example you can work off of based on my descriptions above.

mob/admin/verb/move_to_me(mob/M in world)
// move "M" to my location
M.loc = src.loc


// on login
src.verbs += /mob/admin/verb/move_to_me
In response to Unknown Person
Thanks! But teleport verb needs list of player's where to choose who comes to admin, and I dunno how to do that!
In response to Syntty
var/tmp/list/players = list()

mob/Login()
players += src
..()

mob/Logout()
players -= src
..()


Then, select a mob from the players list.
In response to Garthor
So how do i mix em? Does someone know?
In response to Syntty
So no one knows the answer...
In response to Syntty
What do you mean by mix them?
In response to Syntty
Nobody knows the answer because your question makes no sense.
In response to Garthor
OK, what I mean is that how do you use that Player list in Teleport verb?
In response to Syntty
mob/verb/teleport(var/mob/M in players)
In response to Garthor
K thank!