-
Posts
749 -
Joined
-
Last visited
-
Days Won
1
Everything posted by FlyingSpoon
-
It goes down like credits etc, How can I make that in actual scripting GUI?!
-
Community Resource Forums down?!
FlyingSpoon replied to FlyingSpoon's topic in Site/Forum/Discord/Mantis/Wiki related
Lol, I know It's been back uhhmmm Admin close thread ? -
I am getting a lot of errors as this is my first script, I don't know where the actual error is, and my login doesn't appear on player join neither. There seems to be an error somewhere. CLIENT SIDE --- Main Menu function showMenu() loginMenu = guiCreateWindow(338, 288, 338, 189, "RaysMTA Login v0.1", false) guiWindowSetSizable(loginMenu, false) infoLbl = guiCreateLabel(37, 21, 275, 27, "Welcome to the server, to get started please login/register below! \nYou can view our news by click the news button!\n", false, loginMenu) guiSetFont(infoLbl, "default-small") guiLabelSetColor(infoLbl, 41, 201, 52) usrLbl = guiCreateLabel(147, 55, 48, 15, "Username", false, loginMenu) guiSetFont(usrLbl, "default-small") usrEdit = guiCreateEdit(90, 66, 162, 21, "", false, loginMenu) passLbl = guiCreateLabel(147, 94, 48, 15, "Password", false, loginMenu) guiSetFont(passLbl, "default-small") passEdit = guiCreateEdit(90, 105, 162, 21, "", false, loginMenu) loginBtn = guiCreateButton(10, 153, 69, 27, "Login", false, loginMenu) guiSetFont(loginBtn, "default-small") regBtn = guiCreateButton(260, 153, 69, 27, "Register", false, loginMenu) guiSetFont(regBtn, "default-small") newsBtn = guiCreateButton(137, 152, 68, 28, "News", false, loginMenu) guiSetFont(newsBtn, "default-small") end addEventHandler("onClientPlayerJoin", getRootElement(), showMenu) --- Register Menu function regPlayer(button,state) if (button == "left" and state == "up") then if (source == regBtn) then username = guiGetText(usrEdit) password = guiGetText(passEdit) triggerServerEvent("acceptRegister", getLocalPlayer(), username, password) end end end addEventHandler("onClientGUIClick", getRootElement(), regPlayer) --- Login Menu function logPlayer(button,state) if (button == "left" and state == "up") then if (source == loginBtn) then username = guiGetText(usrEdit) password = guiGetText(passEdit) triggerServerEvent("acceptLogin", getLocalPlayer(), username, password) end end end addEventHandler("onClientGUIClick", getRootElement(), logPlayer) --- Disable Login Menu function closeMenu() guiSetVisible(loginMenu,false) showCursor(false) outputChatBox("You have successfully logged in!") end end addEvent("hideMenu", true) addEventHandler("hideMenu", getRootElement(), closeMenu) SERVER SIDE --- Registering Event function regPlayer(username,password) if not username == "" then if not password == "" then local account = getAccount(username,password) if account == false then local addAcc = addAccount(username,password) if (addAcC) then triggerClientEvent(source,"hideMenu",getRootElement()) outputChatBox("You have successfully registered!", source) else outputChatBox("There was an error! Please contact an administrator!", source) end end end end end addEvent("acceptRegister",true) addEventHandler("acceptRegister",getRootElement(),regPlayer) --- Logging Event function logPlayer(username,password) if not username == "" then if not password == "" then local account = getAccount(username,password) if ( account ~= false ) then outputChatBox("You have successfully logged in!", source) triggerClientEvent(source,"hideMenu",getRootElement()) else outputChatBox("There was an error! Please contact an administrator!", source) end end end end addEvent("acceptLogin",true) addEventHandler("acceptLogin",getRootElement(),logPlayer)
-
PM* What functions do I require to make a login panel
-
Well, community resources places is down and I cant download anything : p
-
Never made an account system before
-
Tell me if I should do that
-
Thank you JR10 This gives me an idea to start a RPG Gamemode as it's a good choice for me and I like working on RPG Sided scripts I hope the MTA Community can help me develop my LUA Skills so I can be successful
-
Well I learnt a little scripting, I am sadly still on the beginner/moving onto more advanced side I want to get more experienced in LUA on the MTA Side, So I fully understand - 'if' statements 'else' statements And I know most of MTA Scripting Wiki, still un-sure about Dx too hard. And now I want to push my self to more advanced scripting such as creating tables, putting arguments in and basically just creating more larger scripts is what I am trying to say. I want to create much bigger systems than smaller one's and want to sooner or later start creating gamemodes by myself and hopefully be as successful as Solidsnake, that's my aim! So can anyone give me any tips, tut's or guides!
-
It worked once now it stopped working haha, wtf?
-
Yay ty JR10! Your awesome
-
WARNING: client.lua:27: Bad argument @ 'triggerServerEvent' [Expected element at argument 2, got nil] function sLobby() setElementPosition ( getLocalPlayer(), 583, -2838, 62 ) local localPlayerName = getPlayerName(getLocalPlayer()) outputChatBox("[iNFO] "..localPlayerName.." has entered the lobby!", 255, 136, 0) end addCommandHandler("lobby", sLobby) localPlayer = source --foodPed = createPed(211, 559.29999, -2856.8, 61.4) dMarker = createMarker(560, -2855, 62, "cylinder", 1.5, 255, 255, 255, 1) addEventHandler("onClientMarkerHit", root, function ( ) if ( source == dMarker ) then eatMenu = guiCreateWindow(441, 242, 130, 111, "Lobby v0.1", false) guiWindowSetSizable(eatMenu, false) wDrink = guiCreateButton(11, 32, 108, 29, "Whiskey", false, eatMenu) wFood = guiCreateButton(11, 67, 108, 29, "Sandwich", false, eatMenu) showCursor(true) end end ) addEventHandler("onClientGUIClick", root, function ( ) if (source == wDrink ) then triggerServerEvent("tDrink", localPlayer) guiSetVisible(eatMenu,false) showCursor(false) end end )
-
Community Resource Forums down?!
FlyingSpoon replied to FlyingSpoon's topic in Site/Forum/Discord/Mantis/Wiki related
Ty -
How can I
-
I have done that on my code as the code wouldnt work, I still did that didnt impact anything still the same.
-
Still don't ;( Doesn't set the animation on me ;( I can give you my gameserver IP and you can see it for yourself?
-
Dont work.
-
Nope don't work still here's the full code - CLIENT SIDE function sLobby() setElementPosition ( getLocalPlayer(), 583, -2838, 62 ) local localPlayerName = getPlayerName(getLocalPlayer()) outputChatBox("[iNFO] "..localPlayerName.." has entered the lobby!", 255, 136, 0) end addCommandHandler("lobby", sLobby) foodPed = createPed(211, 559.29999, -2856.8, 61.4) dMarker = createMarker(560, -2855, 62, "cylinder", 1.5, 255, 255, 255, 1) addEventHandler("onClientMarkerHit", root, function ( ) if ( source == dMarker ) then eatMenu = guiCreateWindow(441, 242, 130, 111, "Lobby v0.1", false) guiWindowSetSizable(eatMenu, false) wDrink = guiCreateButton(11, 32, 108, 29, "Whiskey", false, eatMenu) wFood = guiCreateButton(11, 67, 108, 29, "Sandwich", false, eatMenu) showCursor(true) end end ) addEventHandler("onClientGUIClick", root, function ( ) if (localPlayer == wDrink ) then triggerServerEvent("tDrink", localPlayer) guiSetVisible(eatMenu,false) showCursor(false) end end ) --stop animation [example button 02] function StopAnimation() if source == wDrink then triggerServerEvent("AnimationOff", getLocalPlayer()) guiSetVisible(eatMenu,false) showCursor(false) end end addEventHandler("onClientGUIClick", root, StopAnimation) SERVER SIDE addEvent('tDrink', true ) addEventHandler('tDrink', root, function ( ) daBlockz = getElementData(root,"blockz") daAnimz = getElementData(root,"animz") if daBlockz == "DANCING" and daAnimz == "dnce_m_b" then setPedAnimation(source,false) else setTimer( setPedAnimation, 100, 1, source, "DANCING", "dnce_m_b" ) end end ) --stop animation [example button 02] addEvent ("AnimationOff", true) addEventHandler ("AnimationOff", getRootElement(), function() setPedAnimation ( client ) end)
-
Idk if it's right or wrong But when I press the button for some reason the animation isnt set, you can see the pictures in the spoiler -
-
function takeFood() if source == wDrink then triggerServerEvent("tDrink", getLocalPlayer()) guiSetVisible(eatMenu,false) showCursor(false) end end addEventHandler("onClientGUIClick", root, takeFood) --stop animation [example button 02] function StopAnimation() if source == wDrink then triggerServerEvent("AnimationOff", getLocalPlayer()) guiSetVisible(eatMenu,false) showCursor(false) end end addEventHandler("onClientGUIClick", root, StopAnimation) -- look stop There are no errors outputted in debugscript or MTA Console it seems to work but the animation is not set on me? Why?
-
Please help, I can PM you full script?
-
Don't seem to work.
-
CLIENT - function giveDrink() if source == dMarker then eatMenu = guiCreateWindow(441, 242, 130, 111, "Lobby v0.1", false) guiWindowSetSizable(eatMenu, false) wDrink = guiCreateButton(11, 32, 108, 29, "Whiskey", false, eatMenu) wFood = guiCreateButton(11, 67, 108, 29, "Sandwich", false, eatMenu) showCursor(true) end end addEventHandler("onClientMarkerHit", root, giveDrink) function takeFood() if source == wDrink then triggerServerEvent("tDrink", resourceRoot) guiSetVisible(eatMenu,false) showCursor(false) end end addEventHandler("onClientGUIClick", root, takeFood) SERVER - addEvent ("tDrink", true) addEventHandler ("tDrink", getRootElement(), function() setPedAnimation ( source, "DANCING", "dnce_m_b") end ) -------- addEvent ("tDrinko", true) addEventHandler ("tDrinko", getRootElement(), function() setPedAnimation ( source ) end ) This is what I got