zixxonx Posted August 21, 2013 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.
csiguusz Posted August 21, 2013 Posted August 21, 2013 getPlayerFromNamePart Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
bandi94 Posted August 21, 2013 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") Ingame Name : |DGT|Puma DGT Clan Server 24/7 Owner/Scripter MultiGameMode in progress :
zixxonx Posted August 21, 2013 Author Posted August 21, 2013 Ok, i did it with bandi94 function, thanks! (Can i rep somebody there?)
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