iFrank4927 Posted September 16, 2017 Posted September 16, 2017 Hello guys, i have a error and i dont know how to solve this, hope that u can help me 944 attempt to perform arithmetic on a boleaan value if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(), "currentCol") if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end
koragg Posted September 17, 2017 Posted September 17, 2017 Which line is 944 ? I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
iFrank4927 Posted September 17, 2017 Author Posted September 17, 2017 oh sorry i forgot, if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then
koragg Posted September 18, 2017 Posted September 18, 2017 OK, first of all, you misspelled "getPlayerMaxAviableSlots()". Should be "getPlayerMaxAvailableSlots()" Try this: if itemName and (getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots()) then local col = getElementData(getLocalPlayer(), "currentCol") if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end end I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
iFrank4927 Posted September 18, 2017 Author Posted September 18, 2017 i try but the same error appear
Moderators IIYAMA Posted September 19, 2017 Moderators Posted September 19, 2017 if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then You cannot get the elements within a colshape, if the colshape doesn't exist. So you have to check if it exist, before doing the rest. if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
koragg Posted September 19, 2017 Posted September 19, 2017 2 hours ago, IIYAMA said: if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then You cannot get the elements within a colshape, if the colshape doesn't exist. So you have to check if it exist, before doing the rest. if col and #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then He gave another line as the error to me 1 I love rock/metal/pop but don't mind any other music genre except чалга...that thing sux I also love cars PS I'm friendly
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