Ulysses
Home
Help
Ulysses
»
General
»
Developers Corner
»
Teleport to original spawn
« previous next »
Print
Pages: [
1
]
Go Down
Author
Topic: Teleport to original spawn (Read 4298 times)
0 Members and 1 Guest are viewing this topic.
frustratedgamers
Newbie
Posts: 36
Karma: -1
Teleport to original spawn
«
on:
February 03, 2014, 04:53:03 pm »
Is it possible to make a command that would allow a player to teleport to an original spawn point?
Also if it could be limited to 1 time use that would be great as well.
Logged
MrPresident
Ulysses Team Member
Hero Member
Posts: 2727
Karma: 430
Re: Teleport to original spawn
«
Reply #1 on:
February 03, 2014, 05:58:51 pm »
Check out my !unstuck command for my gamemode. Some things would need to be changed to work with yours, but you should get the general idea.
Code: Lua
function
SGS_UnStick
(
ply
,
_
,
args
)
if
CurTime
(
)
<
(
ply
.
nextunstuck
or
0
)
then
if
math.floor
(
(
ply
.
nextunstuck
-
CurTime
(
)
)
/
60
)
>
0
then
ply
:
SendMessage
(
"You must wait "
..
math.floor
(
(
ply
.
nextunstuck
-
CurTime
(
)
)
/
60
)
..
" more minutes."
,
60
,
Color
(
255
,
0
,
0
,
255
)
)
else
ply
:
SendMessage
(
"You must wait "
..
math.floor
(
ply
.
nextunstuck
-
CurTime
(
)
)
..
" more seconds."
,
60
,
Color
(
255
,
0
,
0
,
255
)
)
end
return
end
local
spawnarea
=
ents
.
FindByClass
(
"info_player_start"
)
local
random_entry
=
math.random
(
#
spawnarea
)
local
newpos
=
spawnarea
[
random_entry
]
:
GetPos
(
)
ply
:
SetPos
(
newpos
)
ply
.
nextunstuck
=
CurTime
(
)
+
300
ply
:
SendMessage
(
"You have been returned to the spawn area."
,
60
,
Color
(
255
,
255
,
128
,
255
)
)
end
concommand
.
Add
(
"sgs_unstuck"
,
SGS_UnStick
)
Logged
frustratedgamers
Newbie
Posts: 36
Karma: -1
Re: Teleport to original spawn
«
Reply #2 on:
February 03, 2014, 09:27:45 pm »
nice! thank you for that, I'll see what I can do
Logged
Print
Pages: [
1
]
Go Up
« previous next »
Ulysses
»
General
»
Developers Corner
»
Teleport to original spawn