Walk around the commands?

I am making this basic gamemode and i want to make this derma menu with a button be able to teleport a player without using commands.

I’ve tried to do it this way:
init.lua
[lua]
function teleport1( ply )
ply:SetPos(Vector(0, 0, 0))
end
[/lua]

cl_init.lua
[lua]
function TheTestGuy()
local person = LocalPlayer()
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( “The Test Guy” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Teleport" )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
	teleport1( person ) -- this is the problem... it just wont teleport, and i dont wanna use a command, i want it to go right on the function. Players should not be albe to use a command in console to do this.
	DermaPanel:Close()
end

end
concommand.Add(“ge_testguymenu”, TheTestGuy )
[/lua]

If it’s possible to “hide” commands, i could use that too.

Call the command ‘permabanme’. There’s no way to do it other than concommands. What is there to stop the player just constantly opening the Derma frame and pressing the button anyway?

That’s not the point, i just really wanna know how to get around the commands, but if you’re right, there is not way.

Stop replying your not being helpfull
init.lua
[lua]
function teleport1( ply )
if ply:IsAdmin() or ply:IsSuperAdmin() then
ply:SetPos(Vector(0, 0, 0))
else
Msg(“No access”)
end
end
concommand.Add(“teleport”,teleport1)
[/lua]
cl_init
[lua]
function TheTestGuy()
local person = LocalPlayer()
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( “The Test Guy” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

for k,v in pairs(player.GetAll()) do
if v:IsAdmin or v:IsSuperAdmin() then
local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Teleport" )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
RunConsoleCommand("teleport")
DermaPanel:Close()
else
local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Admins only" )
DermaButton:SetPos( 25, 50 )
DermaButton:SetSize( 150, 50 )
DermaButton.DoClick = function ()
	DermaPanel:Close()
			end
		end
	end
end

end
concommand.Add(“ge_testguymenu”, TheTestGuy )
[/lua]

He just said he didnt want a console command for it.

You’re correct, guess it’s quite impossible. Are there any way to “hide” these console commands?

I’m just waiting til you can datastream functions. sigh

But yeah, there’s no way to do it without concommands. However, you could make it so it can only be called by some fancy way within the derma.

Well i fixed the console command way, How ever you can use Usermessage.

Usermessages can only be sent from the server to the client.

Stop rating yourself useful, because your not. As Maker said, It can only be used to sent from the server to the client.

Correct me if I’m wrong, but according to http://wiki.garrysmod.com/?title=User_Messages sending from client to the server is possible, and as far as i remeber I did it before ( client -> server )

Edit:
I did some more searching and it is possible, I’ve done it before, so usermessages are the way too go, just make sure you don’t send too much data at once which causes overflows

Sounds reasonable! Ill try it.

Where did you read that it’s possible? umsg.Start doesn’t even exist on the client…

If you make the console command serverside, then the client won’t see it. They would have to open the .dua files and look through them to find it.

If you’re doing this for security reasons, you should change a variable on the server, ex; Ply.AllowTeleport = true, when you’re telling the client to show the derma panel. Then when the client pressed the button, the console command gets run serverside and you make the variable false.

Actually you could just send an empty datastream to toggle the function. That doesn’t send any concommands a client could run. But as I said, anyone competent could just run the code as much as they wanted.
Unless you have something else?
Please, give us more background. Why do you need the player to press a button to teleport themselves, and what makes the derma pop up?
Is it triggered by being on a certain team? A certain place? A certain amount of time into the round while spinning counter-clockwise and ducking? Whatever conditions trigger the derma, you could simply check for them at the other end of the concommand, meaning you couldn’t trigger it without being in the right place to trigger the derma, making it completely useless for anything other than a legitimate use.
Incidentally, ecabc, fuck off. :slight_smile:

Uh, I am English most of that didn’t even make sense.

Neither has any of your posts.

Why reply?

You posted a bunch of bullshit and when Lexic rightly said that you were infact, talking out of your ass, you claim to be illiterate, Which is reflected in your posts.

Edit: This message is hidden because ecabc is on your ignore list.

I should have done that a long while ago…