DaHoM Posted December 6, 2017 Share Posted December 6, 2017 (edited) مشكلتي المرة ذي بسيطة يقلي Error :- bad argument #1 to 'gsub' (string expected, got nill) function convertNumber(number) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end Edited December 6, 2017 by DaHoM Link to comment
Rockyz Posted December 6, 2017 Share Posted December 6, 2017 (edited) اطرح اكوادك في المكان الي استخدمت فيه هذا الفنكشن + عدل الفنكشن الى كذا ومابيجيك اخطاء: function convertNumber(number) local formatted = (number and type(number)=='number')and number or 0 while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end Edited December 6, 2017 by #,+( _xiRoc[K]; > Link to comment
DaHoM Posted December 6, 2017 Author Share Posted December 6, 2017 function A() dxDrawFramedText("Your Point : ( " ..convertNumber(getElementData(localPlayer,"Day")).. " ) || Your Points : ( " ..convertNumber(getElementData(localPlayer,"Day")).. " ) ", screenW * 0.0154, screenH * 0.4896, screenW * 0.2160, screenH * 0.5104, tocolor(0, 255, 50, 255), 0.95, "sans", "left", "top", false, false, false, false, false) end function AB() dxDrawFramedText("Your Point : ( " ..convertNumber(getElementData(localPlayer,"Days")).. " ) || Your Points : ( " ..convertNumber(getElementData(localPlayer,"Days")).. " ) ", screenW * 0.0154, screenH * 0.4896, screenW * 0.2160, screenH * 0.5104, tocolor(0, 255, 50, 255), 0.95, "sans", "left", "top", false, false, false, false, false) end function ABC() if getElementData(localPlayer,"LoginTopDay") then for i, valueT in ipairs(PointGang) do dxDrawFramedText("Best Point: "..valueT[1].. " ("..convertNumber(valueT[2])..")", screenW * 0.0154, screenH * 0.3997, screenW * 0.1398, screenH * 0.4258, tocolor(255, 0, 0, 255), 1.00, "sans", "left", "top", false, false, false, false, false) PlayerBestG = valueT[1] end end end function ABCD() if getElementData(localPlayer,"LoginTopDays") then for i, valueT in ipairs(PointPolice) do dxDrawFramedText("Best Point : "..valueT[1].. " ("..convertNumber(valueT[2])..")", screenW * 0.0154, screenH * 0.4388, screenW * 0.1398, screenH * 0.4648, tocolor(0, 0, 255, 255), 1.00, "sans", "left", "top", false, false, false, false, false) PlayerBestP = valueT[1] end end end Link to comment
DaHoM Posted December 7, 2017 Author Share Posted December 7, 2017 8 hours ago, #Soking said: or 0 Bad Idea 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