Saml1er Posted April 10, 2014 Share Posted April 10, 2014 function getPlayerFromNamePart(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end addCommandHandler ( "ignore", function ( player, cmd, nick ) if ( tostring ( nick ) ) then local ignored = getPlayerFromNamePart(nick ) if ( isElement ( ignored ) and getElementType ( ignored ) == "player" ) then local ignorowani = getElementData ( player, "ignorowani" ) if ( ignorowani [ ignored ] ) then ignorowani [ ignored ] = nil outputChatBox ( "unignored", player, 255, 255, 255, true ) else ignorowani [ ignored ] = true outputChatBox ( "ignored", player, 255, 255, 255, true ) end setElementData ( player, "ignorowani", ignorowani ) else outputChatBox ( "no player", player, 255, 0, 0, true ) end else outputChatBox ( "no nick", player, 255, 0, 0, true ) end end ) Idk how does your system works but anyway you'll need to use https://wiki.multitheftauto.com/wiki/Ge ... omNamePart . EDIT: Seems I'm a little late. 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