• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Advanced getPlayerByNameWildcard

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Hello
This is just a simple improvement of getPlayerByNameWildcard:

Lua:
function getPlayerByWildcard(name)
local check = ""
if(getPlayerByNameWildcard(name) ~= nil or getPlayerByNameWildcard(name.."~")) then
                        check = getPlayerByNameWildcard(name)
                        if check == nil then
                                check = getPlayerByNameWildcard(name.."~")
                        end
else
return false
end
return check
end

With this function "getPlayerByWildcard(partofname)" you can do the same as the normal function, but you can add the ~, but you don't need it..

As I said just a very simple improvement.

Returns false if no player is found and the player if a player is found.
 
Code:
function getPlayerByWildcard(name)
	return ((getPlayerByNameWildcard(name) or getPlayerByNameWildcard(name .."~") ~= nil) or false
end
? xd
 
A little thing yours doesnt return the player it returns just wheater a player matchs the search or not..

I am thinking to much to do such codes xDD
 
Back
Top