opnaiC Posted July 12, 2016 Share Posted July 12, 2016 function wanteds(player) local acc = getPlayerAccount(player) local fac = getAccountData(acc,"Faction") or 0 if (tonumber(fac) == 2) then outputChatBox("Список разыскиваемых:", player, 100, 100, 0) for i, v in ipairs(getElementsByType("player")) do if getPlayerWantedLevel(v) >= 1 then wanted = getPlayerWantedLevel(v) outputChatBox(""..getPlayerName(v).." Уровень розыска: "..wanted.."", player, 100, 100, 0) end end end end addCommandHandler("wanteds", wanteds) What is wrong here ? Link to comment
Bean666 Posted July 12, 2016 Share Posted July 12, 2016 tell us whats wrong in debugscript 3 and what is this script for or what are u trying to do Link to comment
opnaiC Posted July 12, 2016 Author Share Posted July 12, 2016 It should be a police command to get all players that have a wanted level. There is nothing in debugscript ... Link to comment
xyz Posted July 12, 2016 Share Posted July 12, 2016 Do you have an actual police team? If so, change it so that team can use it, as that faction thingy might cause problems Link to comment
Mega9 Posted July 12, 2016 Share Posted July 12, 2016 When things don't work start debugging your code line by line if needed, the culprit may be your account data that may not be set properly so check what it returns before proceeding further (debug outputs). Link to comment
Captain Cody Posted July 12, 2016 Share Posted July 12, 2016 Line 7, = and > are backwards. if getPlayerWantedLevel(v) => 1 then Also line 8, add a local before wanted. Will mess up if alot of people use it in the same time period without local. Link to comment
فاّرس Posted July 12, 2016 Share Posted July 12, 2016 ^ it's >= not => , <= less than or equal to, >= greater than or equal to. Link to comment
opnaiC Posted July 12, 2016 Author Share Posted July 12, 2016 Its working guys thank you Link to comment
Captain Cody Posted July 12, 2016 Share Posted July 12, 2016 Oh yeh never mind, that just didn't look right at all. 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