GetPlayerFromPartialName
Jump to navigation
Jump to search
Syntax
player getPlayerFromNamePart ( string Name )
Required Arguments
- Name: A string containing the name part of the player you want to reference
Returns
Returns: if the Name part is exist then returns a player, false otherwise.
Code
function getPlayerFromNamePart(Name) local player = getPlayerFromName(Name) if (player) then return player end for i,player in ipairs (getElementsByType ("player")) do if (string.find(getPlayerName(player),Name)) then return player end end end