#StrOnG_,) Posted January 9, 2016 Share Posted January 9, 2016 السلام عليكم عندي مشكلة بهذي الاكواد addEventHandler("onClientGUIChanged", root, function () local Text = guiGetText(source) local Text = tonumber(Text) if source == GUIEditor.edit[1] then cost1 = Text*12 Max = 5000 guiSetText ( GUIEditor.label[2], "$"..cost1.."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[1], "5000") end elseif source == GUIEditor.edit[2] then cost2 = Text*13 guiSetText ( GUIEditor.label[4], "$"..cost2.."") guiSetText ( GUIEditor.edit[1], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[2], "5000") end elseif source == GUIEditor.edit[3] then cost3 = Text*19 guiSetText ( GUIEditor.label[5], "$"..cost3.."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[1], "0") if Text > Max then guiSetText ( GUIEditor.edit[3], "5000") end elseif source == GUIEditor.edit[4] then cost4 = Text*16 guiSetText ( GUIEditor.label[6], "$"..cost4.."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[4], "5000") end elseif source == GUIEditor.edit[5] then cost5 = Text*17 guiSetText ( GUIEditor.label[9], "$"..cost5.."") guiSetText ( GUIEditor.edit[4], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[5], "5000") end elseif source == GUIEditor.edit[6] then cost6 = Text*21 guiSetText ( GUIEditor.label[21], "$"..cost6.."") guiSetText ( GUIEditor.edit[7], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[6], "5000") end elseif source == GUIEditor.edit[7] then cost7 = Text*23 guiSetText ( GUIEditor.label[22], "$"..cost7.."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[7], "5000") end elseif source == GUIEditor.edit[8] then cost8 = Text*20 guiSetText ( GUIEditor.label[23], "$"..cost8.."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[7], "0") if Text > Max then guiSetText ( GUIEditor.edit[8], "5000") end elseif source == GUIEditor.edit[9] then cost9 = Text*30 guiSetText ( GUIEditor.label[24], "$"..cost9.."") if Text > Max then guiSetText ( GUIEditor.edit[9], "5000") end elseif source == GUIEditor.edit[10] then cost10 = Text*24 guiSetText ( GUIEditor.label[25], "$"..cost10.."") guiSetText ( GUIEditor.edit[11], "0") if Text > Max then guiSetText ( GUIEditor.edit[10], "5000") end elseif source == GUIEditor.edit[11] then cost11 = Text*25 guiSetText ( GUIEditor.label[26], "$"..cost11.."") guiSetText ( GUIEditor.edit[10], "0") if Text > Max then guiSetText ( GUIEditor.edit[11], "5000") end elseif source == GUIEditor.edit[12] then cost12 = Text*23 guiSetText ( GUIEditor.label[27], "$"..cost12.."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[4], "0") if Text > Max then guiSetText ( GUIEditor.edit[12], "5000") end elseif source == GUIEditor.edit[13] then cost13 = Text*75 guiSetText ( GUIEditor.label[30], "$"..cost13.."") if Text > Max then guiSetText ( GUIEditor.edit[13], "5000") end elseif source == GUIEditor.edit[14] then cost14 = Text*1000 guiSetText ( GUIEditor.label[32], "$"..cost14.."") guiSetText ( GUIEditor.edit[15], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[14], "5000") end elseif source == GUIEditor.edit[15] then cost15 = Text*1000 guiSetText ( GUIEditor.label[33], "$"..cost15.."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[15], "5000") end elseif source == GUIEditor.edit[16] then cost16 = Text*200 guiSetText ( GUIEditor.label[36], "$"..cost16.."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[15], "0") if Text > Max then guiSetText ( GUIEditor.edit[16], "5000") end end if source == GUIEditor.edit[1] or source == GUIEditor.edit[2] or source == GUIEditor.edit[3] or source == GUIEditor.edit[4] or source == GUIEditor.edit[5] or source == GUIEditor.edit[6] or source == GUIEditor.edit[7] or source == GUIEditor.edit[8] or source == GUIEditor.edit[9] or source == GUIEditor.edit[10] or source == GUIEditor.edit[11] or source == GUIEditor.edit[12] or source == GUIEditor.edit[13] or source == GUIEditor.edit[14] or source == GUIEditor.edit[15] or source == GUIEditor.edit[16] then costall = cost1+cost2+cost3+cost4+cost5+cost6+cost7+cost8+cost9+cost10+cost11+cost12+cost13+cost14+cost15+cost16 guiSetText ( GUIEditor.label[12], "Total Money: $"..costall) end end ) الدي بق : Link to comment
#StrOnG_,) Posted January 9, 2016 Author Share Posted January 9, 2016 الي ما يشوفها بوضوح Link to comment
#StrOnG_,) Posted January 9, 2016 Author Share Posted January 9, 2016 أمممممممممممم ! Link to comment
justboy Posted January 9, 2016 Share Posted January 9, 2016 addEventHandler("onClientGUIChanged", root, function () local Text = guiGetText(source) local Text = tonumber(Text) if source == GUIEditor.edit[1] then cost1 = Text*12 Max = 5000 guiSetText ( GUIEditor.label[2], "$"..tostring(cost1).."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[1], "5000") end elseif source == GUIEditor.edit[2] then cost2 = Text*13 guiSetText ( GUIEditor.label[4], "$"..tostring(cost2).."") guiSetText ( GUIEditor.edit[1], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[2], "5000") end elseif source == GUIEditor.edit[3] then cost3 = Text*19 guiSetText ( GUIEditor.label[5], "$"..tostring(cost3).."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[1], "0") if Text > Max then guiSetText ( GUIEditor.edit[3], "5000") end elseif source == GUIEditor.edit[4] then cost4 = Text*16 guiSetText ( GUIEditor.label[6], "$"..tostring(cost4).."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[4], "5000") end elseif source == GUIEditor.edit[5] then cost5 = Text*17 guiSetText ( GUIEditor.label[9], "$"..tostring(cost5).."") guiSetText ( GUIEditor.edit[4], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[5], "5000") end elseif source == GUIEditor.edit[6] then cost6 = Text*21 guiSetText ( GUIEditor.label[21], "$"..tostring(cost6).."") guiSetText ( GUIEditor.edit[7], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[6], "5000") end elseif source == GUIEditor.edit[7] then cost7 = Text*23 guiSetText ( GUIEditor.label[22], "$"..tostring(cost7).."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[7], "5000") end elseif source == GUIEditor.edit[8] then cost8 = Text*20 guiSetText ( GUIEditor.label[23], "$"..tostring(cost8).."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[7], "0") if Text > Max then guiSetText ( GUIEditor.edit[8], "5000") end elseif source == GUIEditor.edit[9] then cost9 = Text*30 guiSetText ( GUIEditor.label[24], "$"..tostring(cost9).."") if Text > Max then guiSetText ( GUIEditor.edit[9], "5000") end elseif source == GUIEditor.edit[10] then cost10 = Text*24 guiSetText ( GUIEditor.label[25], "$"..tostring(cost10).."") guiSetText ( GUIEditor.edit[11], "0") if Text > Max then guiSetText ( GUIEditor.edit[10], "5000") end elseif source == GUIEditor.edit[11] then cost11 = Text*25 guiSetText ( GUIEditor.label[26], "$"..tostring(cost11).."") guiSetText ( GUIEditor.edit[10], "0") if Text > Max then guiSetText ( GUIEditor.edit[11], "5000") end elseif source == GUIEditor.edit[12] then cost12 = Text*23 guiSetText ( GUIEditor.label[27], "$"..tostring(cost12).."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[4], "0") if Text > Max then guiSetText ( GUIEditor.edit[12], "5000") end elseif source == GUIEditor.edit[13] then cost13 = Text*75 guiSetText ( GUIEditor.label[30], "$"..tostring(cost13).."") if Text > Max then guiSetText ( GUIEditor.edit[13], "5000") end elseif source == GUIEditor.edit[14] then cost14 = Text*1000 guiSetText ( GUIEditor.label[32], "$"..tostring(cost14).."") guiSetText ( GUIEditor.edit[15], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[14], "5000") end elseif source == GUIEditor.edit[15] then cost15 = Text*1000 guiSetText ( GUIEditor.label[33], "$"..tostring(cost15).."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[15], "5000") end elseif source == GUIEditor.edit[16] then cost16 = Text*200 guiSetText ( GUIEditor.label[36], "$"..tostring(cost16).."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[15], "0") if Text > Max then guiSetText ( GUIEditor.edit[16], "5000") end end if source == GUIEditor.edit[1] or source == GUIEditor.edit[2] or source == GUIEditor.edit[3] or source == GUIEditor.edit[4] or source == GUIEditor.edit[5] or source == GUIEditor.edit[6] or source == GUIEditor.edit[7] or source == GUIEditor.edit[8] or source == GUIEditor.edit[9] or source == GUIEditor.edit[10] or source == GUIEditor.edit[11] or source == GUIEditor.edit[12] or source == GUIEditor.edit[13] or source == GUIEditor.edit[14] or source == GUIEditor.edit[15] or source == GUIEditor.edit[16] then costall = cost1+cost2+cost3+cost4+cost5+cost6+cost7+cost8+cost9+cost10+cost11+cost12+cost13+cost14+cost15+cost16 guiSetText ( GUIEditor.label[12], "Total Money: $"..tostring(costall)) end end ) Link to comment
#StrOnG_,) Posted January 9, 2016 Author Share Posted January 9, 2016 addEventHandler("onClientGUIChanged", root, function () local Text = guiGetText(source) local Text = tonumber(Text) if source == GUIEditor.edit[1] then cost1 = Text*12 Max = 5000 guiSetText ( GUIEditor.label[2], "$"..tostring(cost1).."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[1], "5000") end elseif source == GUIEditor.edit[2] then cost2 = Text*13 guiSetText ( GUIEditor.label[4], "$"..tostring(cost2).."") guiSetText ( GUIEditor.edit[1], "0") guiSetText ( GUIEditor.edit[3], "0") if Text > Max then guiSetText ( GUIEditor.edit[2], "5000") end elseif source == GUIEditor.edit[3] then cost3 = Text*19 guiSetText ( GUIEditor.label[5], "$"..tostring(cost3).."") guiSetText ( GUIEditor.edit[2], "0") guiSetText ( GUIEditor.edit[1], "0") if Text > Max then guiSetText ( GUIEditor.edit[3], "5000") end elseif source == GUIEditor.edit[4] then cost4 = Text*16 guiSetText ( GUIEditor.label[6], "$"..tostring(cost4).."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[4], "5000") end elseif source == GUIEditor.edit[5] then cost5 = Text*17 guiSetText ( GUIEditor.label[9], "$"..tostring(cost5).."") guiSetText ( GUIEditor.edit[4], "0") guiSetText ( GUIEditor.edit[12], "0") if Text > Max then guiSetText ( GUIEditor.edit[5], "5000") end elseif source == GUIEditor.edit[6] then cost6 = Text*21 guiSetText ( GUIEditor.label[21], "$"..tostring(cost6).."") guiSetText ( GUIEditor.edit[7], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[6], "5000") end elseif source == GUIEditor.edit[7] then cost7 = Text*23 guiSetText ( GUIEditor.label[22], "$"..tostring(cost7).."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[8], "0") if Text > Max then guiSetText ( GUIEditor.edit[7], "5000") end elseif source == GUIEditor.edit[8] then cost8 = Text*20 guiSetText ( GUIEditor.label[23], "$"..tostring(cost8).."") guiSetText ( GUIEditor.edit[6], "0") guiSetText ( GUIEditor.edit[7], "0") if Text > Max then guiSetText ( GUIEditor.edit[8], "5000") end elseif source == GUIEditor.edit[9] then cost9 = Text*30 guiSetText ( GUIEditor.label[24], "$"..tostring(cost9).."") if Text > Max then guiSetText ( GUIEditor.edit[9], "5000") end elseif source == GUIEditor.edit[10] then cost10 = Text*24 guiSetText ( GUIEditor.label[25], "$"..tostring(cost10).."") guiSetText ( GUIEditor.edit[11], "0") if Text > Max then guiSetText ( GUIEditor.edit[10], "5000") end elseif source == GUIEditor.edit[11] then cost11 = Text*25 guiSetText ( GUIEditor.label[26], "$"..tostring(cost11).."") guiSetText ( GUIEditor.edit[10], "0") if Text > Max then guiSetText ( GUIEditor.edit[11], "5000") end elseif source == GUIEditor.edit[12] then cost12 = Text*23 guiSetText ( GUIEditor.label[27], "$"..tostring(cost12).."") guiSetText ( GUIEditor.edit[5], "0") guiSetText ( GUIEditor.edit[4], "0") if Text > Max then guiSetText ( GUIEditor.edit[12], "5000") end elseif source == GUIEditor.edit[13] then cost13 = Text*75 guiSetText ( GUIEditor.label[30], "$"..tostring(cost13).."") if Text > Max then guiSetText ( GUIEditor.edit[13], "5000") end elseif source == GUIEditor.edit[14] then cost14 = Text*1000 guiSetText ( GUIEditor.label[32], "$"..tostring(cost14).."") guiSetText ( GUIEditor.edit[15], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[14], "5000") end elseif source == GUIEditor.edit[15] then cost15 = Text*1000 guiSetText ( GUIEditor.label[33], "$"..tostring(cost15).."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[16], "0") if Text > Max then guiSetText ( GUIEditor.edit[15], "5000") end elseif source == GUIEditor.edit[16] then cost16 = Text*200 guiSetText ( GUIEditor.label[36], "$"..tostring(cost16).."") guiSetText ( GUIEditor.edit[14], "0") guiSetText ( GUIEditor.edit[15], "0") if Text > Max then guiSetText ( GUIEditor.edit[16], "5000") end end if source == GUIEditor.edit[1] or source == GUIEditor.edit[2] or source == GUIEditor.edit[3] or source == GUIEditor.edit[4] or source == GUIEditor.edit[5] or source == GUIEditor.edit[6] or source == GUIEditor.edit[7] or source == GUIEditor.edit[8] or source == GUIEditor.edit[9] or source == GUIEditor.edit[10] or source == GUIEditor.edit[11] or source == GUIEditor.edit[12] or source == GUIEditor.edit[13] or source == GUIEditor.edit[14] or source == GUIEditor.edit[15] or source == GUIEditor.edit[16] then costall = cost1+cost2+cost3+cost4+cost5+cost6+cost7+cost8+cost9+cost10+cost11+cost12+cost13+cost14+cost15+cost16 guiSetText ( GUIEditor.label[12], "Total Money: $"..tostring(costall)) end end ) قام يجي مشاكل بالدي بق بملف السيرفر كله ملف السيرفر addEvent("BuyWeapon", true) addEventHandler("BuyWeapon", root, function (costall2,ID16,ID22,ID23,ID24,ID25,ID26,ID28,ID29,ID30,ID31,ID32,ID33,ID34,ID35,ID36,ID38) if getPlayerMoney(source) >= tonumber(costall2) then takePlayerMoney ( source,costall2) if ID16 > 0 then giveWeapon(source, 16, ID16) end if ID22 > 0 then giveWeapon(source, 22, ID22) end if ID23 > 0 then giveWeapon(source, 23, ID23) end if ID24 > 0 then giveWeapon(source, 24, ID24) end if ID25 > 0 then giveWeapon(source, 25, ID25) end if ID26 > 0 then giveWeapon(source, 26, ID26) end if ID28 > 0 then giveWeapon(source, 28, ID28) end if ID29 > 0 then giveWeapon(source, 29, ID29) end if ID30 > 0 then giveWeapon(source, 30, ID30) end if ID31 > 0 then giveWeapon(source, 31, ID31) end if ID32 > 0 then giveWeapon(source, 32, ID32) end if ID33 > 0 then giveWeapon(source, 33, ID33) end if ID34 > 0 then giveWeapon(source, 34, ID34) end if ID35 > 0 then giveWeapon(source, 35, ID35) end if ID36 > 0 then giveWeapon(source, 36, ID36) end if ID38 > 0 then giveWeapon(source, 38, ID38) end end end ) ولما ابي اشتري شي يجي بالدي بق server.lua:21:attempt to compare numper with nil 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