Jump to content

Lloyd Logan

Members
  • Posts

    642
  • Joined

  • Last visited

Everything posted by Lloyd Logan

  1. Right guys, Wondering how to to link MTA SA with Mysql, now this may be stupid if someone has already posted a topic about it could you link me to it?. What i mean is, in big scripts such as Valhalla, Vedic etc. , they have a folder named Mysql, but how do they get it, i can set up a big script, but it is no use setting it up if you don't understand any of it,, How do you link MTA:SA with Mysql and Sqlite etc,? Please forgive if this makes me look stupid in some way, or if the question is stupid, but hey, we all need to learn!! Thanks again, Lloyd
  2. No i didn't, a guy made them for me, but i now realise he isn't very clever, any suggestions?
  3. Nothing for lazyquery, but do I check anywhere else
  4. So add it in under getmysqlport?
  5. "King Roleplay" type="script" description="MySQL"/>
  6. Nope There is nothing there?
  7. [2012-07-20 23:21:46] ERROR: call: failed to call 'mysql:lazyQuery' [string "?"] Is the Error I am getting whilst trying to add a new gate, please help... Thanks in advance, Lloyd
  8. You can simply use if not var then Thanks Alot
  9. Lloyd Logan

    Set Hp

    Right Guys, i tried to create a resource to set a players hp, could you tell me whats wrong, lol the console says it could even find the resource, here is the serverside function setElementHealth ( sourcePlayer, command, targetPlayerName) --look up the player whos health has to be set local targetPlayer = getPlayerFromName ( targetPlayerName ) --if there is a player with such name subtract tonumber from their health, if targetPlayer then setElementHealth ( getElementID, getElementHealth, - ( tonumber(setElementHealth) ) --check if the players health returned "false" if (setElementHealth == false) then -- if so, output a message to the chatbox, but only to this player. outputChatBox ("Failed to set players hp." ,thePlayer) end end addCommandHandler("sethp", setElementHealth) here is the meta "llsd" type="script" name="hpslap" description="set hp" /> Could you correct me in with any errors thanks lloyd
  10. So, when the server is up on the browser, the default mode is play, but when i put in a custom resource and start it the gamemode changes to the name of the resource!
  11. Why when i put a new resource in my server does the servers type change to the name of the resource? Thanks Lloyd
  12. 1959.55, -1714.46, 13
  13. Sorry, Should've Mentioned, already tried that nothing happens.
  14. Lloyd Logan

    Spawn Under Map

    Hi Guys, I followed MTA scripting guide for a basic spawn, But the problem is i spawn under the map and fall to the ground, Help!
  15. Is it Somthing hard just to wind me up, or easy?
  16. Hi Guys I have followed https://wiki.multitheftauto.com/wiki/Int ... the_window tutorial of how to create a gui of a login window, 1st of all nothing comes up when i log in, so i tried to go for a simpler option of just a login in the chatbox, but the accounts aren't being created HELP!!! And i cant get it to work, here is the client side function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) -- define new X and Y positions for the first label X = 0.0825 Y = 0.2 -- define new Width and Height values for the first label Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window) guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value, so the second label is slightly below the first Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50 guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- make the window invisible guiSetVisible(wdwLogin, false) end guiSetVisible(wdwLogin, false) --hides all the GUI we made so we can show them to the player at the appropriate moment. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () -- create the log in window and its components createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to My MTA:SA Server, please log in.") -- if the GUI was successfully created, then show the GUI to the player if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) end ) function createLoginWindow() -- create all our GUI elements ... -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function createLoginWindow() -- create all our GUI elements ... -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function clientSubmitLogin(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(edtUser) -- get the text entered in the 'password' field local password = guiGetText(edtPass) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitLogin", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui outputChatBox("Please enter a username and password.") end end end Here is the meta "Lloyd" type="gamemode" name="GUI" description="GUI" /> And here is the Server side pls help function loginHandler(username,password) -- check that the username and password are correct if username == "user" and password == "apple" then -- the player has successfully logged in, so spawn them if (client) then spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Welcome to My Server.", client) end else -- if the username or password are not correct, output a message to the player outputChatBox("Invalid username and password. Please re-connect and try again.",client) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) PLS PLS PLS Help me or send me the finished client and server side script from the MTA website! Thanks Alot, Lloyd
  17. Hi Guys I have followed https://wiki.multitheftauto.com/wiki/Int ... the_window tutorial of how to create a gui of a login window, 1st of all nothing comes up when i log in, so i tried to go for a simpler option of just a login in the chatbox, but the accounts aren't being created HELP!!! And i cant get it to work, here is the client side unction createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) -- define new X and Y positions for the first label X = 0.0825 Y = 0.2 -- define new Width and Height values for the first label Width = 0.25 Height = 0.25 -- create the first label, note the final argument passed is 'wdwLogin' meaning the window -- we created above is the parent of this label (so all the position and size values are now relative to the position of that window) guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) -- alter the Y value, so the second label is slightly below the first Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) -- set the maximum character length for the username and password fields to 50 guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) -- make the window invisible guiSetVisible(wdwLogin, false) end guiSetVisible(wdwLogin, false) --hides all the GUI we made so we can show them to the player at the appropriate moment. addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () -- create the log in window and its components createLoginWindow() -- output a brief welcome message to the player outputChatBox("Welcome to My MTA:SA Server, please log in.") -- if the GUI was successfully created, then show the GUI to the player if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) else -- if the GUI hasnt been properly created, tell the player outputChatBox("An unexpected error has occurred and the log in GUI has not been created.") end -- enable the players cursor (so they can select and click on the components) showCursor(true) -- set the input focus onto the GUI, allowing players (for example) to press 'T' without the chatbox opening guiSetInputEnabled(true) end ) function createLoginWindow() -- create all our GUI elements ... -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function createLoginWindow() -- create all our GUI elements ... -- now add our onClientGUIClick event to the button we just created addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end function clientSubmitLogin(button,state) if button == "left" and state == "up" then -- get the text entered in the 'username' field local username = guiGetText(edtUser) -- get the text entered in the 'password' field local password = guiGetText(edtPass) -- if the username and password both exist if username and password then -- trigger the server event 'submitLogin' and pass the username and password to it triggerServerEvent("submitLogin", getRootElement(), username, password) -- hide the gui, hide the cursor and return control to the player guiSetInputEnabled(false) guiSetVisible(wdwLogin, false) showCursor(false) else -- otherwise, output a message to the player, do not trigger the server -- and do not hide the gui outputChatBox("Please enter a username and password.") end end end Here is the meta And here is the Server side pls help function loginHandler(username,password) -- check that the username and password are correct if username == "user" and password == "apple" then -- the player has successfully logged in, so spawn them if (client) then spawnPlayer(client, 1959.55, -1714.46, 10) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Welcome to My Server.", client) end else -- if the username or password are not correct, output a message to the player outputChatBox("Invalid username and password. Please re-connect and try again.",client) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) PLS PLS PLS Help me or send me the finished client and server side script from the MTA website! Thanks Alot, Lloyd
  18. Thanks SS14 Any Ideas on Simple Scripting, Thanks Lloyd
  19. Hi Guys, Was just wondering how to view your Co-ordinates in game as it is really irritating me now? And another thing, could someone give me a small list some good things a beginner scripter can... well script, so far I have done Simple Login/Register and a Teleporter, some other simple, but useful things would be appreciated, Thanks Lloyd
  20. Thank you, Though I do not want money through being a scripter doesn't mean i am not good at it, I have been scripting for 4 years and have a full time job, i have previously scripted for Revolution Roleplay and Trollin' Roleplay. I do have a lot of experience in roleplay servers so do hesitate to contact me. Thanks Lloyd Logan
×
×
  • Create New...