Best-Killer Posted November 27, 2016 Share Posted November 27, 2016 hackcld = {} addEvent("giveMny", true) addEventHandler("giveMny", root, function (mny) local vip = getElementData ( client, "VIP" ) if isTimer(hackcld[getPlayerSerial(client)]) then return exports.SAEGMessages:sendClientMessage( "ATM: can't hack the ATM now!",client, 255, 0, 0) end if ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 2 ) then mny = mny+mny*0.25 elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 3 ) then mny = mny+mny*0.5 elseif ( exports.SAEGVIP:getVipLevelFromName ( vip ) == 4 ) then mny = mny+mny*0.75 end givePlayerMoney(client, math.floor(mny)) hackcld[getPlayerSerial(client)] = setTimer(function () end, 175000, 1) exports.SAEGMessages:sendClientMessage( "ATM: You successfully hacked the ATM and got "..mny.."$!",client, 0, 255, 0) end) addEventHandler("onClientGUIClick",root, function () local client = getLocalPlayer() if ( source == GUIEditor.button[12] ) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif ( source == GUIEditor.button[13] ) then local mode = nil if guiRadioButtonGetSelected ( GUIEditor.radiobutton[1] ) then mode = 'deposit' else mode = 'withdraw' end triggerServerEvent ( "SAEGBank:ModifyAccount", localPlayer, tostring ( mode ), tonumber ( guiGetText ( GUIEditor.edit[2] ) ) ) end if ( source == GUIEditor.button[1] ) then mny = (4999) triggerServerEvent ( "giveMny",client,mny) end end ) Vip can't get more than 4999$ (it's fine with not vips players ) giving 4999$ no errors no warnings with is the problem guys ? Link to comment
Captain Cody Posted November 27, 2016 Share Posted November 27, 2016 Please explain the issue better. Link to comment
Best-Killer Posted November 27, 2016 Author Share Posted November 27, 2016 i'm trying to make more payout to vips players when hack the atm did you understand ? Link to comment
Best-Killer Posted November 28, 2016 Author Share Posted November 28, 2016 any help ? Link to comment
cacao Posted November 28, 2016 Share Posted November 28, 2016 (edited) local i = math.floor((0.1+0.7)*10) print (i) -- 7, not 8 Maybe, you about this? this thing in several languages Test this in lua online: https://goo.gl/Wh2apy Be careful when you work with floating-point numbers. Edited November 28, 2016 by cacao 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