DiGiTal Posted June 7, 2017 Share Posted June 7, 2017 Hi, i'm learned lua,finished now, i came to mtasa functions... ,i created a panel if anyone wanna to teleport he need to pay ! for the server.lua had, i went to client, and i don't know how to script the buttons. thx server: function (player,amount) if getPlayerMoney( player ) >= 30000 then takePlayerMoney( player, 30000 ) then end end client: GUIEditor = { checkbox = {} } addEventHandler("onClientResourceStart", resourceRoot, function wdwPay () window = guiCreateWindow(0.39, 0.36, 0.22, 0.38, "SADZ Cinema HD", true) guiWindowSetSizable(window, false) guiSetAlpha(window, 0.67) GUIEditor.checkbox[1] = guiCreateCheckBox(391, 141, 0, 48, "", false, false, window) label1 = guiCreateLabel(0.19, 0.17, 0.63, 0.11, "pay", true, window) guiSetFont(label1, "default-bold-small") guiLabelSetHorizontalAlign(label1, "left", true) label2 = guiCreateLabel(0.38, 0.17, 0.62, 0.11, "50,000$", true, window) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 14, 67, 0) edit1 = guiCreateEdit(48, 92, 222, 26, "", false, window) button1 = guiCreateButton(0.32, 0.54, 0.47, 0.09, "PAY", true, window) guiSetFont(button1, "default-bold-small") end ) guiSetVisible(wdwPay, false) Link to comment
AHMED MOSTAFA Posted June 7, 2017 Share Posted June 7, 2017 function (player,amount) amount is guiGetText ( edit1 ) ??? test it ... -- server function takemymoney ( amount ) if getPlayerMoney ( client ) >= 30000 then takePlayerMoney ( client, 30000 ) then end end addEvent ( "takeMoney", true ) addEventHandler ( "takeMoney", root, takemymoney ) -- client window = guiCreateWindow(0.39, 0.36, 0.22, 0.38, "SADZ Cinema HD", true) guiWindowSetSizable(window, false) guiSetAlpha(window, 0.67) guiSetVisible( window , false) checkbox = guiCreateCheckBox(391, 141, 0, 48, "", false, false, window) label1 = guiCreateLabel(0.19, 0.17, 0.63, 0.11, "pay", true, window) guiSetFont(label1, "default-bold-small") guiLabelSetHorizontalAlign(label1, "left", true) label2 = guiCreateLabel(0.38, 0.17, 0.62, 0.11, "50,000$", true, window) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 14, 67, 0) edit1 = guiCreateEdit(48, 92, 222, 26, "", false, window) button1 = guiCreateButton(0.32, 0.54, 0.47, 0.09, "PAY", true, window) guiSetFont(button1, "default-bold-small") function onClick () if source == button1 then triggerServerEvent ( "takeMoney", localPlayer, guiGetText ( edit1 ) ) end end addEventHandler ( "onClientGUIClick", root, onClick ) 1 Link to comment
DiGiTal Posted June 7, 2017 Author Share Posted June 7, 2017 (edited) it's the price ! argument 2 but thx !!!! Edited June 7, 2017 by Ridden 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