Jump to content

FlyingSpoon

Members
  • Posts

    749
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by FlyingSpoon

  1. BUMP It is unable to get the datas, e.g. data["member_id"], data["name"], it worked when I used callRemote, but fails to work now since it is not getting the data through the arguments, any ideas how I can fix this? function UserLogin(userName,Password,Checksave) if not (userName == "") then if not (Password == "") then fetchRemote("http://forums.link.com/login.php", function(response,errno,player) local response = fromJSON(response) if type(response) == "table" then if response.status == "SUCCESS" then triggerClientEvent(player,"loginHide",getRootElement()) triggerClientEvent(player,"showNotification",player, "Successfully logged in!", "success") UserData("success", data["member_id"], data["name"], player, userName, Password, Checksave) else if response.msg == "ACCOUNT_NOT_FOUND" then triggerClientEvent(player,"showNotification",player, "Account doesn't exist!", "error") elseif response.msg == "ACCOUNT_INVALID_PASSWORD" then triggerClientEvent(player,"showNotification",player, "Password doesn't match!", "error") else outputDebugString("UNRECOGNISED RESPONSE @ "..getPlayerName(player)"'s login attempt.") end end elseif response == "ERROR" then triggerClientEvent(player,"showNotification",player, "Internal error. Please try again later. (Code "..errno..")", "error") outputDebugString("INTERNAL ERROR "..errno.." @ "..getPlayerName(player)"'s login attempt.") else outputDebugString("PARSING ERROR @ "..getPlayerName(player)"'s login attempt.") -- maybe the response was sent in a way other than a table, but its not an error either end end , toJSON({user=userName, pass=Password}), false, source) else triggerClientEvent(source,"showNotification",source, "Please enter your password!", "error") end else triggerClientEvent(source,"showNotification",source, "Please enter your username!", "error") end end addEvent("UserWantToLogin",true) addEventHandler("UserWantToLogin",getRootElement(),UserLogin) function UserData(Status,UserID,uName,player,userName,Password,Checksave) if Status == "success" then if not getAccount (UserID) then acc = addAccount(tostring(UserID),tostring(Password)) end if not getAccount(UserID,Password) then setAccountPassword(getAccount(UserID),Password) end local acc = getAccount ( UserID,Password) if(not isGuestAccount(acc)) then logOut(player); end logIn (player, acc, Password) setElementData(player,"getForumID",UserID) setElementData(player,"getForumName",uName) end end
  2. Oh I get the dbQuery part now, handle dbQuery ( [ function callbackFunction, [ table callbackArguments, ] ] element databaseConnection, string query [, var param1 [, var param2 ...]] ) That you can enter a function before the connection, I didn't know that. Is nrQ the query?
  3. Worked, but why is the loop as a variable? local q = dbQuery(function(nrQ)) And what is nrQ?
  4. FlyingSpoon

    Question

    So I want to get some data from my database and insert it into a table or make it into a table so I can run a few things e.g. local general = {} addEventHandler("onResourceStart", root, function() local q = dbQuery(connection, "SELECT * FROM table") local r = dbPoll(q, -1) general = { {r["first"], r["second"]} } end) function run() for i, v in ipairs(general) do outputChatBox(v[1].." - "..v[2], player) end addCommandHandler("runme", run) How would I go about doing this?
  5. I know the basics of MTA LUA that's not an issue. It's that I haven't used Shaders before, it's not my strongest sector of MTA Scripting. It's fine, I think I've got the hang of it by playing around with it for a few hours.
  6. Applying texture to the vehicle. I suppose they split a GIF apart into pngs and created a "progress" of it. Eg. Png files = 1.png, 2.png, 3.png So you create a counter from 1 to 3, and apply that texture to the vehicle. I asked you what functions should I use to apply the texture.
  7. Uhm, I haven't really used .fx files before or touched them. Can I have an example maybe?
  8. I see, how would I go about doing it? Which functions would I require?
  9. I've seen it in a few servers, what type of script is it, what is it using, it is a GIF, Video what? And what function are they using to apply it onto it.
  10. Works like charm, cheers. - Closed
  11. So how would I go about making a unique index for all my 9 elements, e.g. local arenas = { {"Arena1"}, {"Arena2"}, {"Arena3"}, {"Arena4"}, ... } for i, v in ipairs(arenas) do uniqueValue?? = createElement(...) end
  12. FlyingSpoon

    Issue

    attempt to index field '?' (a string value) for ID, Arena in ipairs(arenas) do Arena[1].Element = createElement("Arena", Arena[1]); end The element name should be unique, since there's around 8 elements I need to create.
  13. Decent Community, got banned for bug abusing when I wasn't. I reported it beforehand but still I got banned and my main character got removed. Poorly developed systems though, seem way too rushed and unorganized by looking at your client side code and once again I don't see anything new, it's just another standard roleplay server like any other out there.
  14. Would be interesting to put it up. It would in a way (if people use your maps) want them to have a more stable map. Putting something like that on the line, is definitely an option.
  15. Are you resources optimised, what are the full specifications of the server? And is it a Fair Share CPU Usage? I'd personally try out OVH or Zade Servers.
  16. The Beginning (Script Update #1) (December, 2017): https://forums.lc-rp.com/topic/62-the-beginning-script-update-1-v003a-december-2017/
  17. Community Update #5: Team CRT - https://forums.lc-rp.com/index.php?/topic/59-liberty-news-5-community-relations-team/&tab=comments#comment-196
  18. Sorry for the lack of updates recently, as we've been experiencing some difficulties with the Forums we have decided to switch software's and use something that's more flexible and easier for the team, as well as the players. The important topics have been moved over onto the Forums, and some have been removed. Remember to re-register and inform someone from the #management if you experience any issues or bugs. https://forums.lc-rp.com/ We've also got a background changer, so feel free to choose what you prefer, lets get started!
  19. Hey there, Small update regarding Forums, people could not register earlier so this has now been fixed. If you tried to register before but failed to I apologize for any inconvenience. Thank you.
  20. Thank you, @Uknown., I'm glad you like our work. A small update regarding the site is that now we have a new homepage, more interactive and user friendly, displaying Forum Related Topics as well as other upcoming features. We've also revamped our Forum theme, be sure to check that out as well. Finally, we've moved all of our Site Related resources onto a more powerful machine, therefore we'll have much faster load times, to make sure that we are getting information across to the audience properly and within decent time. Also I'd like to take my time and thank everyone that has supported this project so far, we've almost hit our first 100 Members that are registered on our Forums which is amazing for myself, and the Liberty Team. Thank you guys! Homepage: http://lc-rp.com Forums: http://forums.lc-rp.com
  21. local hover = false; showCursor(true); function renderTicks() if not hover then start = getTickCount(); --outputDebugString("1: "..start) end if hover then start = getTickCount(); --outputDebugString("2: "..start) end end addEventHandler("onClientRender", root, renderTicks) function dxDraw() dxDrawRectangle(567, 263, 229, 236, tocolor(0, 0, 0, 206), false); if isMouseInPosition(567, 263, 229, 236) then hover = true; move = interpolateBetween(0, 0, 0, 236, 0, 0, ((getTickCount()-start)/500), "Linear"); else hover = false; move = interpolateBetween(0, 0, 236, 0, 0, 0, ((getTickCount()-start)/500), "Linear"); end dxDrawRectangle(567, 263, 229, move, tocolor(189, 131, 131, 206), false); end addEventHandler("onClientRender", getRootElement(), dxDraw) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end Don't know what I've done, but it seems like it isn't working anymore xD.
  22. Haven't touched interpolate in a long while, just want to get up to date with it again. So I'm just experimenting and I'm trying to make it so that when I move into the DX Square, an overlay comes down, and when I leave the square it the overlay goes back up, into height = 0. showCursor(true); local start = getTickCount(); function dxDraw() local begin = ( ( getTickCount() - start ) / 500 ); dxDrawRectangle(567, 263, 229, 236, tocolor(0, 0, 0, 206), false); if isMouseInPosition(567, 263, 229, 236) then move = interpolateBetween(0, 0, 0, 236, 0, 0, begin, "Linear"); else move = interpolateBetween(0, 0, 236, 0, 0, 0, begin, "Linear"); end dxDrawRectangle(567, 263, 229, move, tocolor(189, 131, 131, 206), false); end addEventHandler("onClientRender", getRootElement(), dxDraw) function isMouseInPosition ( x, y, width, height ) if ( not isCursorShowing( ) ) then return false end local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy ) if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else return false end end Right now, it only goes up as soon as the script starts, if I move into it later it just shows a random square appearing when I go inside the position, but doesn't animate.
×
×
  • Create New...