Advanced Filter

From HLSW Wiki

Revision as of 14:27, 18 January 2009 by Kenterfie (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

HLSW Advanced Filter

The HLSW advanced filter interface give you the possibilty to create own filters for your server lists with the Lua Programming Language. The global variable "serverobj" is a instance of the class ServerObject and represent the current server. The advanced filter is called for every server. More information about the class ServerObject can you find in the Lua Functions reference.

Examples of a HLSW Advanced Filter

-- Get all servers with less then 10 player on it
if serverobj:GetPlayerCount() > 10 then
    return false
end

-- Get all servers with 'aztec' into the mapname
if string.find(serverobj:GetMapName(), "aztec") == nil then
   return false
end

return true

since HLSW v1.3.1

-- Get all servers without AMXX or FriendlyFire ON
if RulesExist(serverobj, {"amxmodx_version"}) or FindRule(serverobj, "mp_friendlyfire", "1") then
 return false
end
return true

HLSW LUA Functions

Lua Functions

References

Lua Manual

Personal tools