No it wont work because of: function et_ConsoleCommand(clientNum, command) --Called when a command is entered on the server console should be et_ClientCommand( clientNum, command ) -> Called when a command is received from a client if et.trap_Argv(0) == "getmyguid" then local guid = et.Info_ValueForKey(et.trap_GetUserinfo(playerID),"sil_guid") --playerID is nil -> not defined et.trap_SendServerCommand(clientNum, "print \"^osilEnT GUID: ^7"..guid.."\n")--clientNum is nil (see above) return 1 ---return 1 here...if not have getmyguid comand will be 0..unreconize comand end end fixed lua and I added !help myguid. You could also add a check level to just give it to some admins. ----------------------------------------------------------------------
-- Filename: myguid.lua
----------------------------------------------------------------------
-- MyGUID - Prints your silEnT GUID just like /cl_guid would for etkey based GUIDs.
----------------------------------------------------------------------
-- Created by =F|A=Chuckun
-- If you use it, please donate to our clan to help fund the servers
-- Any amount will help!!
-- Fearless-Assassins.com
----------------------------------------------------------------------
-- !myguid or /!myguid
----------------------------------------------------------------------
------------------------------------------ name ----------------------------------------------
Modname = "silEnT GUID Command"
Version = "1.0"
------------------------------------------ settings ----------------------------------------------
commandprefix = "!" --command prefix (! shrubbot like)
myguid_cmd = "myguid" --shrubbot command (can be shortened to example "myg"
--just like !listplayers -> !list !listp !listplay
printposition = "chat" --message position
----------------------------------------- functions ---------------------------------------------
function et_InitGame(levelTime,randomSeed,restart)
et.G_Print("["..Modname.."] Version: "..Version.." Loaded\n")
et.RegisterModname(Modname.." "..Version.. " "..et.FindSelf())
end
---------------------------------- client command functions ------------------------------
function et_ClientCommand(client, command)
local argv0 = string.lower(et.trap_Argv(0)) --first argv if you use / will be myguid_cmd
local argv1 = string.lower(et.trap_Argv(1)) --et.trap_Argv(0) is say/say_buddy/say_team and et.trap_Argv(1) is myguid_cmd
local argv2 = string.lower(et.trap_Argv(2))
--string.lower so you ca write it in upper and/or lower letters
-------//--------------------Command----------------------------
if string.find(argv0, "^"..commandprefix.."" .. myguid_cmd .. "") or string.find(argv1, "^"..commandprefix.."" .. myguid_cmd .. "") then --use string.find so it's not needed to write full command.
local userinfo = et.trap_GetUserinfo( client )
local guid = string.upper(et.Info_ValueForKey( userinfo, "sil_guid" ))
if guid == nil or guid == "" then guid = "UNKNOWN" end --in case client doesn't have no guid set it to UNKNOWN
et.trap_SendServerCommand(client, ""..printposition.." \"^osilEnT GUID: ^7"..guid.."\"")
if string.find(argv0, "^"..commandprefix.."" .. myguid_cmd .. "") then
return 1 --return 1 so no error message will be printed^if /command is used
end
end
if argv1 == ""..commandprefix.."help" and string.find(argv2, "^" .. myguid_cmd .. "") then -- !help myguid
et.trap_SendServerCommand(client, ""..printposition.." \"^oFunction: ^7print your ^osilEnT GUID\"" )
end
return 0
end