zixxonx Posted August 21, 2013 Share Posted August 21, 2013 Hi, i want to do command like this. !yo [part of the other player nick] Then it'll bring up (My nick): Yo, (player) for example: if name of the player is: VeryBigFoot5776 and i type !yo verybig it'll show (My Nick): Yo, VeryBigFoot5776 I already coded everything what i need, just dont know how to get player full name from just part. Link to comment
bandi94 Posted August 21, 2013 Share Posted August 21, 2013 function getPlayerNameFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return getPlayerName(player) end end end return false end local fullname = getPlayerNameFromNamePart("name part") Link to comment
zixxonx Posted August 21, 2013 Author Share Posted August 21, 2013 Ok, i did it with bandi94 function, thanks! (Can i rep somebody there?) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now