I may sound really dumb asking this because its probally really simple but how to make a console chat command run a console command...
FOR EXAMPLE(not what i wont):
Console command: ULX Menu
TO
Chat: /ulx
thanks anyway!
-snip-
[QUOTE=michaelevil;45637097]I may sound really dumb asking this because its probally really simple but how to make a console chat command run a console command...
FOR EXAMPLE(not what i wont):
Console command: ULX Menu
TO
Chat: /ulx
thanks anyway![/QUOTE]
[code]
concommand.Add( "ULX Menu",function( ply )
ply:ConCommand( "say", "/ulx" )
end )
[/code]
or
[code]
hook.Add( "PlayerSay", "ChatCommand", function( ply, text, public )
if (string.sub(text, 1, 4) == "/ulx" then
ply:ConCommand("ulx menu")
end
end)
[/code]
does this go into or no?
garrysmod\lua\autorun\server
[editline]9th August 2014[/editline]
nvm i got it tanks btw you missed something
you had:
[CODE]hook.Add( "PlayerSay", "ChatCommand", function( ply, text, public )
if (string.sub(text, 1, 4) == "/ulx" then
ply:ConCommand("ulx menu")
end
end)[/CODE]
i changed it to:
[CODE]hook.Add( "PlayerSay", "ChatCommand", function( ply, text, public )
if (string.sub(text, 1, 4)) == "/ulx" then
ply:ConCommand("ulx menu")
end
end)[/CODE]
Sorry, you need to Log In to post a reply to this thread.