AW: Konsolenkommando mit bestimmter funktion
Das in garrysmod/lua/autorun/client
Code:
function configload( )
LocalPlayer():ConCommand("load_my_config\n")
end
concommand.Add("loadconfig", configload)
und das in garrysmod/cfg/autoexec.cfg schreiben
Code:
alias "load_my_config" "exec <configname>"
bind "loadconfig" // könntest eigentlich gleich load_my_config binden , so isses aber in LUA ^^ das du nebencommands wie sounds dazu machen kannst wie AKTIVIERT usw^^
so kannste beliebig unentliche chat commands mit verschiedenen Configs hinzufügen...
Beispiel im Spoiler.
Sogar mit BIIP sound beim config load.
Spoiler:
Spoiler anzeigen
Code:
function sound( )
LocalPlayer():ConCommand("play buttons\blip1.wav\n")
end
function configloadplayer( )
LocalPlayer():ConCommand("load_player\n")
sound( )
end
function configloaddriver( )
LocalPlayer():ConCommand("load_driver\n")
sound( )
end
function configloadafk( )
LocalPlayer():ConCommand("load_afk\n")
sound( )
end
concommand.Add("player", configloadplayer)
concommand.Add("driver", configloaddriver)
concommand.Add("afk", configloadafk)
und das in garrysmod/cfg/autoexec.cfg schreiben
Code:
alias "load_player" "exec player"
alias "load_driver" "exec driver"
alias "load_afk" "exec afk
bind "F5" "player"
bind "F6" "driver"
bind "F7" "afk"
Hoffe ich konnte helfen. :gmod:
AW: Konsolenkommando mit bestimmter funktion