So I am trying to make it so admins can teleport to a pre-made position on the map. The problem is that when they use the command SetPos -384.987091 1477.868774 124.031250;setang 2.235619 -178.996307 0.000000 in console it doesn't work because Sv_Cheats isn't set to "1". Is it possible to Teleport to co-ordinates with Sv_Cheats set to "0"? Any help would be greatly appreciated!
Setpos is a default source command. I'd just make a command in Lua that teleports them to that location, like so:
[code]
local ADMIN_POS = Vector( -384.987091, 1477.868774, 124.031250)
local CONCOMMAND_TEXT = 'adminpos'
local CHATCOMMAND_TEXT = '!adminpos'
hook.Add('PlayerSay', 'IDK', function(ply, text, public)
if text == CHATCOMMAND_TEXT then
ply:SetPos(ADMIN_POS)
end
end)
concommand.Add(CONCOMMAND_TEXT, function(ply)
ply:SetPos(ADMIN_POS)
end)
[/code]
Alternatively, you can just make a command in Lua that teleports them to a location.
Awesome, I appreciate it greatly!
[editline]14th June 2015[/editline]
[QUOTE=AK to Spray;47957987]Setpos is a default source command. I'd just make a command in Lua that teleports them to that location, like so:
[code]
local ADMIN_POS = Vector( -384.987091, 1477.868774, 124.031250)
local CONCOMMAND_TEXT = 'adminpos'
local CHATCOMMAND_TEXT = '!adminpos'
hook.Add('PlayerSay', 'IDK', function(ply, text, public)
if text == CHATCOMMAND_TEXT then
ply:SetPos(ADMIN_POS)
end
end)
concommand.Add(CONCOMMAND_TEXT, function(ply)
ply:SetPos(ADMIN_POS)
end)
[/code]
Alternatively, you can just make a command in Lua that teleports them to a location.[/QUOTE]
I last question, where in the server should i put the .lua? I have it in /addons/darkrpmodification-master/lua/darkrp_customthings currently and it isn't working.
If you're running this on a server, and it's in an addon format, then you'll need to include the addon in your server's files. Also, in the lua directory, put that in the autorun/server section.
Sorry, you need to Log In to post a reply to this thread.