Apo Posted May 9, 2016 Share Posted May 9, 2016 hi When I entered my server , in the my sql i have wanted 3 but no show my wanted Wanted\wantedlevels.lua:10: attempt to concatenate local 'wanted' (a nil value) if not (targetPlayer) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] ", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName =findPlayerByPartialNick(thePlayer, targetPlayer) if targetPlayer then local logged = getElementData(targetPlayer, "login") if (logged==1) then local wanted = tonumber(getElementData(targetPlayer,"wanted")) outputChatBox ("player have ae "..wanted..".",thePlayer) end end end end addCommandHandler("getwanted",getwanted) Link to comment
Captain Cody Posted May 9, 2016 Share Posted May 9, 2016 That means the element data probably is not there, or non existent. if not (targetPlayer) then outputChatBox("SYNTAX: /" .. commandName .. " [Player Partial Nick / ID] ", thePlayer, 255, 194, 14) else local targetPlayer, targetPlayerName =findPlayerByPartialNick(thePlayer, targetPlayer) if targetPlayer then local logged = getElementData(targetPlayer, "login") if (logged==1) then local wanted = tonumber(getElementData(targetPlayer,"wanted")) or 0 outputChatBox ("player have ae "..wanted..".",thePlayer) end end end end addCommandHandler("getwanted",getwanted) May work. 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