Zero.o Posted July 25, 2013 Share Posted July 25, 2013 olha aqui da erro nela alguem pode me ajudar queria faser um resource com o comando de /avisar addCommandHandler ( "aviso", aviso ) function aviso (theAdmin) outputChatBox ('#00FFFF' .. getPlayerName(thePlayer) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00getAdminName(theAdmin)#FFFFFF Motivo:getMotivo(theMotivo) )', root, 255, 255, 255, true) end obrigado Link to comment
Vision Posted July 25, 2013 Share Posted July 25, 2013 Tenta isso function aviso ( theAdmin, _, thePlayer, ... ) local thePlayer = getPlayerFromName ( thePlayer ) local motivo = table.concat ( { ... }, ' ' ) if ( thePlayer and ... ) then outputChatBox ( '#00FFFF' .. getPlayerName ( thePlayer ) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00' .. getPlayerName ( theAdmin ) .. '#FFFFFF) Motivo: ' .. motivo, thePlayer, 255, 255, 255, true ) else outputChatBox ( '/aviso ', theAdmin, 255, 0, 0 ) end end addCommandHandler ( 'aviso', aviso ) Link to comment
Zero.o Posted July 25, 2013 Author Share Posted July 25, 2013 Vlwww manow mais ele preciza de cor para avisar queria saber se tem como faser pelo ID ou pelo nome sem código? mais obrrrrrrrrrrrrrrrrrrrrrrrrrrgado msm assim Link to comment
Vision Posted July 25, 2013 Share Posted July 25, 2013 Assim? function getPlayerFromNamePart ( name ) if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( string.find ( string.gsub ( getPlayerName ( player ) : lower ( ), "#%x%x%x%x%x%x", "" ), tostring ( name ) : lower ( ), 1, true ) ) then return player end end end return false end function aviso ( theAdmin, _, thePlayer, ... ) local thePlayer = getPlayerFromNamePart ( thePlayer ) local motivo = table.concat ( { ... }, ' ' ) if ( thePlayer and ... ) then outputChatBox ( '#00FFFF' .. getPlayerName ( thePlayer ) .. ' #828282Você foi avisado pelo #FFFFFF(#00FF00' .. getPlayerName ( theAdmin ) .. '#FFFFFF) Motivo: ' .. motivo, thePlayer, 255, 255, 255, true ) else outputChatBox ( '/aviso ', theAdmin, 255, 0, 0 ) end end addCommandHandler ( 'aviso', aviso ) 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