Dolinho Posted October 12, 2014 Share Posted October 12, 2014 This gives me random players: getRandomPlayer() How do I find a player first? It takes a lot to find in random, and that's too bad have any precise way to find a player? accurately find. addEvent("Marktres",true) addEventHandler("Marktres",root, function (wanter) local wanter = getRandomPlayer() local theName = getPlayerName ( source ) if (getPlayerWantedLevel(wanter) == 3) then setTimer ( function() outputChatBox("Procurando Niveis 3..", source, 0, 255,255, true) end,1000, 1 ) setTimer ( function() outputChatBox("Registrando...", source, 0, 255,255, true) end,2000, 1 ) setTimer ( function() outputChatBox("Altenticando....", source, 0, 255,255, true) end,3000, 1 ) setTimer ( function() outputChatBox("Um Meliante "..getPlayerName(wanter).." Encontrado pelo sistema policial...", source, 0, 255,255, true) outputChatBox ( "Dica quanto mais Criminosos com estrela, mais facil fica para achalos", source ) exports.killmessages:outputMessage("*"..getPlayerName(wanter).." Esta sendo Oficialmente procurado pela PM.", root, 255, 15, 15, true) local blip = createBlipAttachedTo(wanter, 19) end,4000, 1 ) else outputChatBox ( "Verifique se realmente tenha jogadores com 3 nivel de procurado.", source ) outputChatBox ( "Caso tenha, procure ate achar.", source ) end end ) Link to comment
MTA Team botder Posted October 12, 2014 MTA Team Share Posted October 12, 2014 Do you want to get a player by (partial) name? Link to comment
Dolinho Posted October 12, 2014 Author Share Posted October 12, 2014 Yes, like having it? Link to comment
MTA Team botder Posted October 12, 2014 MTA Team Share Posted October 12, 2014 Here: GetPlayerFromNamePart Link to comment
Dolinho Posted October 12, 2014 Author Share Posted October 12, 2014 It is not that. What I want is to be more precise to find players with level sought. local wanter = getRandomPlayer() Finding player with precision that are really wanted level. getRandomPlayer this finding random player, I want fixed player. Link to comment
DNL291 Posted October 12, 2014 Share Posted October 12, 2014 function getPlayersWithWantedLevel(level) if type(level) == "number" then local total = 0 for _,player in ipairs(getElementsByType("player")) do if getPlayerWantedLevel(player) == level then total = total + 1 end end return total end return false end e.g: outputChatBox( getPlayersWithWantedLevel(3) ) Is that what do you mean? 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