-
Posts
749 -
Joined
-
Last visited
-
Days Won
1
Everything posted by FlyingSpoon
-
I think it works, but it doesn't set the animation on me for some reason, when I press my button nothing happens.
-
Doesn't set the animation for me.
-
server.lua:3: 'end' expected (to close 'function' at line 1) near 'else' server.lua:3: 'end' expected (to close 'function' at line 1) near 'else' function tDrink () setPedAnimation ( thePlayer, "VENDING", "VEND_Drink_P", 2.1, false) else setPedAnimation ( thePlayer ) end addEvent("tDrink", true) addEventHandler("tDrink", root, tDrink)
-
Well I am trying to get this animation to work on me when I hit a certain button, but it says bad argument, SERVER SIDE function tDrink () setPedAnimation ( thePlayer, "VENDING", "VEND_Drink_P", 2.1, false) end addEvent("tDrink", true) addEventHandler("tDrink", root, tDrink)
-
the setElementData seems to be the problem for me.
-
Can you show me how it's done :~( I am really confused.
-
Well I tried that, but I was worried about the guiGetText, how will I do, givePlayerMoney( source, amt ) ? amt == Client Side
-
Well I got somewhere Ty for your help guys +1 !! So now the new problem is, I want to move the givePlayerMoney server-side any ideas how I can do it? Please someone help. loanMenu = guiCreateWindow(349, 240, 354, 310, "Loan-System v0.1", false) guiWindowSetSizable(loanMenu, false) loanLabel = guiCreateLabel(9, 26, 81, 21, "Loan Amount: ", false, loanMenu) guiSetFont(loanLabel, "default-small") loanEd = guiCreateEdit(71, 21, 164, 27, "Enter 50000-500000", false, loanMenu) loanInfo = guiCreateLabel(9, 52, 325, 37, "Enter the loan amount you wish to receive,\nMinimum: $50,000\nMaximum: $500,000\n", false, loanMenu) guiSetFont(loanInfo, "default-small") loanClose = guiCreateButton(304, 279, 41, 22, "Close", false, loanMenu) guiSetFont(loanClose, "default-small") bSubmit = guiCreateButton(240, 22, 99, 32, "Submit", false, loanMenu) guiSetVisible(loanMenu,false) function openIt() guiSetVisible(loanMenu,true) showCursor(true) end addCommandHandler("loanv1", openIt) function closeIt() if loanClose then guiSetVisible(loanSys, false) showCursor(false) end end addEventHandler("onClientGUIClick", resourceRoot, closeIt) function pressMyButton() if source==bSubmit then local amt = tonumber(guiGetText(loanEd)) if amt then if amt>=50000 and amt<=500000 then givePlayerMoney ( amt ) else outputChatBox("Enter amount between 50000 and 500000.") end else outputChatBox("Enter something.") end end end addEventHandler("onClientGUIClick",root,pressMyButton)
-
It works great, Now it the 'givePlayerMoney' part which is not being detected, When I hit submit nothing happens, But the rest happens if I type it below, or above that number a text is outputted This happens when I hit submit with a value between them 2 numbers. WARNING: loanv1\client.lua:33: Bad argument @ 'givePlayerMoney' [Expected number at argument 1, got gui-button] loanMenu = guiCreateWindow(349, 240, 354, 310, "Loan-System v0.1", false) guiWindowSetSizable(loanMenu, false) loanLabel = guiCreateLabel(9, 26, 81, 21, "Loan Amount: ", false, loanMenu) guiSetFont(loanLabel, "default-small") loanEd = guiCreateEdit(71, 21, 164, 27, "Enter 50000-500000", false, loanMenu) loanInfo = guiCreateLabel(9, 52, 325, 37, "Enter the loan amount you wish to receive,\nMinimum: $50,000\nMaximum: $500,000\n", false, loanMenu) guiSetFont(loanInfo, "default-small") loanClose = guiCreateButton(304, 279, 41, 22, "Close", false, loanMenu) guiSetFont(loanClose, "default-small") bSubmit = guiCreateButton(240, 22, 99, 32, "Submit", false, loanMenu) guiSetVisible(loanMenu,false) function openIt() guiSetVisible(loanMenu,true) showCursor(true) end addCommandHandler("loanv1", openIt) function closeIt() if loanClose then guiSetVisible(loanSys, false) showCursor(false) end end function pressMyButton() if source==bSubmit then local amt = tonumber(guiGetText(loanEd)) if amt then if amt>=50000 and amt<=500000 then givePlayerMoney ( source, amt ) else outputChatBox("Enter amount between 50000 and 500000.") end else outputChatBox("Enter something.") end end end addEventHandler("onClientGUIClick",root,pressMyButton)
-
loanMenu = guiCreateWindow(349, 240, 354, 310, "Loan-System v0.1", false) guiWindowSetSizable(loanMenu, false) loanLabel = guiCreateLabel(9, 26, 81, 21, "Loan Amount: ", false, loanMenu) guiSetFont(loanLabel, "default-small") loanEd = guiCreateEdit(71, 21, 164, 27, "Enter 50000-500000", false, loanMenu) loanInfo = guiCreateLabel(9, 52, 325, 37, "Enter the loan amount you wish to receive,\nMinimum: $50,000\nMaximum: $500,000\n", false, loanMenu) guiSetFont(loanInfo, "default-small") loanClose = guiCreateButton(304, 279, 41, 22, "Close", false, loanMenu) guiSetFont(loanClose, "default-small") bSumbit = guiCreateButton(240, 22, 99, 32, "Submit", false, loanMenu) guiSetVisible(loanMenu,false) function openIt() guiSetVisible(loanMenu,true) showCursor(true) end addCommandHandler("loanv1", openIt) function closeIt() if loanClose then guiSetVisible(loanSys, false) showCursor(false) end end function pressMyButton() if source==bSubmit then local amt = tonumber(guiGetText(loanEd)) if amt then if amt>=50000 and amt<=500000 then givePlayerMoney ( source, amt ) else outputChatBox("Enter amount between 50000 and 500000.") end else outputChatBox("Enter something.") end end end addEventHandler("onClientGUIClick",root,pressMyButton) I did this but it didn't work still, I also attempt to press 'Close' and it still doesn't work! Help please
-
Well, I need help haha, by help I meant someone fixing my code so I can learn from it for future references.. Sorry if you mis-understood me.
-
Your script has a slight bug, When I start/restart it, it output's - Enter something. local amt = tonumber(guiGetText(loanEd)) if amt and bSumbit then if amt>=50000 and amt<=500000 then givePlayerMoney ( source, amt ) else outputChatBox("Enter amount between 50000 and 500000.") end else outputChatBox("Enter something.") end I tried doing this but no luck
-
Well, before I do anything else, I want the person to enter an amount between, $50,000 - $500,000 So if they enter an amount over it it will output a message saying, please enter an amount between them to numbers and the same if they enter an amount less then it. function loanSys() loanMenu = guiCreateWindow(349, 240, 354, 310, "Loan-System v0.1", false) guiWindowSetSizable(loanMenu, false) loanLabel = guiCreateLabel(9, 26, 81, 21, "Loan Amount: ", false, loanMenu) guiSetFont(loanLabel, "default-small") loanEd = guiCreateEdit(71, 21, 164, 27, "Enter 50000-500000", false, loanMenu) loanInfo = guiCreateLabel(9, 52, 325, 37, "Enter the loan amount you wish to receive,\nMinimum: $50,000\nMaximum: $500,000\n", false, loanMenu) guiSetFont(loanInfo, "default-small") loanClose = guiCreateButton(304, 279, 41, 22, "Close", false, loanMenu) guiSetFont(loanClose, "default-small") bSumbit = guiCreateButton(240, 22, 99, 32, "Submit", false, loanMenu) showCursor(true) end addCommandHandler("loanv1", loanSys) function closeIt() if loanClose then guiSetVisible(loanSys, false) showCursor(false) end end So, basically when they enter the amount in the guiEdit and hit the Submit button if it is between 50-50000 then they get that amount and a message gets output's like the example below, e.g. 15000, so they get $15,000 and this message gets outputted, outputChatBox("You have received $15,000!") Anyone help me please!
-
RaysMTA.eu - FREE Gameserver handout!
FlyingSpoon replied to FlyingSpoon's topic in Hosting solutions
Read Topic - http://raysmta.eu/forums/index.php?topic=11.0 -
As you may know, our MTA Server Plans are not yet active, they will be active very soon, stay updated by visiting the link http://raysmta.com Visit Blimp Hosting Packages: https://www.blimphosting.com/billing/aff.php?aff=2
-
Hi there, I have made the gamemode, a public, free downloadable gamemode. This is due to me being very inactive with other activities IRL, and I am sorry for this, so I don't have time to open a gameserver. You can download the resource straight from here - http://raysmta.eu ( If you won't mind, please register ) More information about resource there! https://forum.multitheftauto.com/viewtopic.php?f=115&t=82452
-
Never mind it appears !
-
I tried it, here's the code, test = exports.SDT_GUI:dxCreateWindow(500,200,250,300,"Character Selection",tocolor(0,179,255,255),"default-small","Lighter Black") exports.SDT_GUI:dxCreateButton(500,200,250,300,"Hello!",test,tocolor(255,0,0,255),"default-bold","Orange") Now the problem is window appears, but button doesn't!
-
I have no code, I just took the example from MTA Wiki and entered it into the script, it dont work though.
-
Window works fine, its the rest, like buttons dont work.
-
Hi there, I found this public community resource : https://community.multitheftauto.com/index.php?p= ... ls&id=4871 However, I saw that the wiki had a lot of removed functions and many didn't work. I want to create a simple window with buttons, can anyone help me? I am really stuck!
-
Bump, anyone help?
-
Well I figured something out, the command works with /settingsmenu, however now the problem is when I hit close it disables the cursor but Dx dont go. ----------------------- -- The Menu -- ----------------------- function DxMenu() font = dxCreateFont("Digital.ttf",30) dxDrawRectangle(261, 125, 292, 287, tocolor(50, 160, 212, 144), false) dxDrawRectangle(312, 196, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 197, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawLine(261, 170, 552, 170, tocolor(1, 1, 1, 219), 1, true) dxDrawRectangle(312, 255, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 256, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(312, 316, 186, 43, tocolor(0, 0, 0, 255), false) dxDrawRectangle(313, 317, 184, 41, tocolor(50, 160, 212, 255), false) dxDrawRectangle(481, 380, 70, 29, tocolor(0, 0, 0, 255), false) dxDrawRectangle(482, 381, 68, 27, tocolor(50, 160, 212, 255), false) gameSet = dxDrawText("Game Settings", 359, 269, 431, 287, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Help Menu", 371, 210, 443, 228, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Coming Soon...", 359, 329, 431, 347, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) closeBtn = dxDrawText("Close", 498, 386, 534, 400, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "top", false, false, true, false, false) dxDrawText("Settings Menu", 335, 128, 434, 155, tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, true, false, false) end ----------------------- ----------------------- -- Menu Moved -- ----------------------- function bindKeys() bindKey("F1", "down", F1RPhelp) end addEventHandler("onClientResourceStart", getRootElement(), bindKeys) function resetState() pressed = false end function F1RPhelp() outputChatBox("This menu has been moved to /settingsmenu!", 0, 179, 255) end ---------------------- ---------------------- -- Binded CMD -- ---------------------- function cmdType() addEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(true) DxMenu = true end addCommandHandler("settingsmenu", cmdType) ---------------------- ---------------------- -- Test -- ---------------------- function bTest() tWindow = guiCreateWindow(233, 251, 297, 226, "", false) guiWindowSetSizable(tWindow, false) end local menuState = false ----------------------- -- Clicks -- ----------------------- function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing ( ) ) then return false end local sx, sy = guiGetScreenSize ( ) -- Get the player screen resolution local cx, cy = getCursorPosition ( ) -- Get the cursor position local cx, cy = ( cx * sx ), ( cy * sy ) -- Convert relative positions to absolute if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end addEventHandler ( "onClientClick", root, function ( ) if ( DxMenu ) then if isMouseInPosition ( 481, 380, 70, 29 ) then removeEventHandler("onClientRender", getRootElement(), DxMenu) showCursor(false) end end end ) -------------------------