Hello i’m looking for a lua script that automaticly adds to the clan members/admins the clan tag only when the members have their level does a script like this exist?if yes can you give me a link for that?Thanks in advance
looking for a script
Don’t know of anything with auto tag, but i made something real quick for you. I can’t test it to tell you if it works, but let me know (make sure you edit clantag and minlevel
–[[
Auto Tag Lua made by Purple/DRiVJ
4-21-2015
version 0.1
]]
– Put your clan tag here with color codes.
clantag = “faketag”
– Your clans lowest ADMIN level.
minlevel = “3”
function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname(“AutoTag By Purple”)
end
function et_ClientBegin( clientNum )
local level = et.G_shrubbot_level(clientNum)
local name = et.Info_ValueForKey(et.trap_GetUserinfo(client), “name”)
if level >= minlevel then
if not string.find(name, “”…clantag…"") then
et.trap_SendConsoleCommand(et.EXEC_APPEND, “!rename “…clientNum…” “…clantag…””…name…"" )
end
end
end
also if there are more useful lua scripts for server just give me a link i’m interested in those scripts
i tested the autotag script nope something it’s not working corectly the erros says the following:
Lua API:et_ClientBegin error running lua script: [string “autotag.lua”]:20: bad argument #1 to ‘trap_GetUserinfo’ (number expected, got nil)
Ahh sorry about that was a mistake i overlooked anyways here is a working (i hope?) one.
Also take a look at LESM ( lua enhanced server mod) has a lot of nice features for servers and is compatible with most mods.
https://bitbucket.org/zelly/lua-enhanced-server-mod/wiki/Home
–[[
Auto Tag Lua made by Purple/DRiVJ
4-21-2015
version 0.2
changelog:
0.2: fixed small error
]]
– Put your clan tag here with color codes.
clantag = “faketag”
– Your clans lowest ADMIN level.
minlevel = “3”
function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname(“AutoTag 0.2 By Purple”)
end
function et_ClientBegin( clientNum )
local level = et.G_shrubbot_level(clientNum)
local name = et.Info_ValueForKey(et.trap_GetUserinfo(clientNum), “name”)
if level >= minlevel then
if not string.find(name, “”…clantag…"") then
et.trap_SendConsoleCommand(et.EXEC_APPEND, “!rename “…clientNum…” “…clantag…””…name…"" )
end
end
end
the script is loaded but won’t rename the members the error is
Lua API: et_ClientBegin error running lua script: [string “autotag.lua”]:23: attempt to compare string with number
i feel really stupid but remove the “” from minlevel
E.g should be minlevel = 3
not minelevel “3”
and i know this works because i went and got my server **** from my pc in states.
the script works but something is weird some member are named like .DMG|playername!rename or like .DMG|.DMG|.DMG| they told me that server renamed them like that
I guess it’s because you’re clantag has a “.” in it which is a magic character. I took a stab at fixing it:
--[[
Auto Tag Lua made by Purple/DRi*VJ*
4-22-2015
version 0.3
changelog:
0.3:
removed unnecessary "
changed string.find to check for nil
escaped clantag
0.2: fixed small error
]]
-- Put your clan tag here with color codes.
clantag = "faketag"
-- Your clans lowest ADMIN level.
minlevel = 3
local matches =
{
["^"] = "%^";
["$"] = "%$";
["("] = "%(";
[")"] = "%)";
["%"] = "%%";
["."] = "%.";
["["] = "%[";
["]"] = "%]";
["*"] = "%*";
["+"] = "%+";
["-"] = "%-";
["?"] = "%?";
}
function escape_lua_pattern(s)
return (s:gsub(".", matches))
end
function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname("AutoTag By Purple")
clantag = escape_lua_pattern(clantag)
end
function et_ClientBegin( clientNum )
local level = et.G_shrubbot_level(clientNum)
local name = et.Info_ValueForKey(et.trap_GetUserinfo(clientNum), "name")
if level >= minlevel then
if string.find(name, clantag) != nil then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "!rename "..clientNum.." "..clantag..name )
end
end
end
now it won’t load the script the error says the following line:
Lua API: syntax error during pre-compilation: [string “autotag.lua”]:50: ‘then’ expected near ‘!’
meh here just retarded mistakes guess i should stop trying to half ass everything. @ stealth you fixed my mistake instantly which was on string.find i used the variable like …clantag… should of just been clantag everything else in your script is non-needed + the expression =! is not valid in lua it would be ~= but nice try
this one works i tried multiple names multiple colors and different tags including .$@&*! chars.
sorry for the sloppyness just tried to put it together real quick.
--[[
Auto Tag Lua made by Purple/DRi*VJ*
4-22-2015
version 0.3
changelog:
0.2: fixed small error
0.3 if not string.find had chat strings instead of the variable.. derp
also added ^7 color code white after the tag just in case if the users name is white
and the tag color codes are different it wont effect the clients name.
]]
-- Put your clan tag here with color codes.
clantag = ".DMG|"
-- Your clans lowest ADMIN level.
minlevel = 0
function et_InitGame(levelTime, randomSeed, restart)
et.RegisterModname("AutoTag 0.3 By Purple")
end
function et_ClientBegin( clientNum )
local level = et.G_shrubbot_level(clientNum)
local name = et.Info_ValueForKey(et.trap_GetUserinfo(clientNum), "name")
if level >= minlevel then
if not string.find(name, clantag) then
et.trap_SendConsoleCommand(et.EXEC_APPEND, "!rename "..clientNum.." "..clantag.."^7"..name.."" )
end
end
end
still there is one thing that still bothers me,when clan members are connecting to the server with the name and both tag the server adds another tag.Can this be fixed?
This should be fixed as said i test many different names etc and it was not adding extra tags to me. thats what this “if not string.find(name, clantag) then” is for it checks to see if they have the clan tag in the name or not. if they dont it gives em it.