Jump to content

kPkPT

Members
  • Posts

    14
  • Joined

  • Last visited

kPkPT's Achievements

Square

Square (6/54)

1

Reputation

  1. Thanks! Really helped out +rep
  2. Hey guys, So i am kinda stuck here. I don't know any movetype for DGS Gui. I mean if i place an empty string the gui element will just keep going forward on dgsMoveTo and if i set movetype to nil it doesn't move at all, only teleports. Anyone knows existing movetypes?
  3. Okay so i got this now: addEvent("animateDX",true) function animateDX(message) if(w1 > (screenW * 0.8776)) then w1 = w1 -10 dxDrawRectangle(w1, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) addEventHandler("onClientPreRender",getRootElement(),animateDX) end if(w1 <= (screenW * 0.8776)) then dxDrawRectangle(screenW * 0.8776, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) dxDrawText("Info", screenW * 0.8953, screenH * 0.7898, screenW * 0.9807, screenH * 0.8093, tocolor(43, 155, 21, 255), 1.00, "bankgothic", "center", "center", false, true, false, false, false) dxDrawText(message, screenW * 0.8927, screenH * 0.8185, screenW * 0.9859, screenH * 0.8759, tocolor(254, 255, 255, 255), 1.25, "sans", "center", "top", false, true, false, false, false) setTimer(function() removeEventHandler("onClientPreRender",root,animateDX) end,5000,1) end end addEventHandler("animateDX",root,animateDX) Still does not work. If i try to call animateDX("something") for example it won't show "something" in the dxDrawText. WHy?
  4. It is not exacly that i wanted. See this is going to be some kind of information system. So i need to call it from other function with a desired string.
  5. Hey guys, so i got two functions, and i want it to be that when i call the first one with a string as an argument, that one calls the second one with the same string. That is not happening, the string the second one receives is "16" or "17" always. Here's the code function animateDX(text) w1 = w1 -10 dxDrawRectangle(w1, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) addEventHandler("onClientPreRender",getRootElement(),animateDX) if(w1 < (screenW * 0.8776)) then dxText(text) removeEventHandler("onClientPreRender",getRootElement(),animateDX) end end animateDX("Information") function dxText(text) dxDrawRectangle(screenW * 0.8776, screenH * 0.7898, screenW * 0.1224, screenH * 0.1083, tocolor(35, 35, 35, 255), false) dxDrawText("Info", screenW * 0.8953, screenH * 0.7898, screenW * 0.9807, screenH * 0.8093, tocolor(43, 155, 21, 255), 1.00, "bankgothic", "center", "center", false, true, false, false, false) dxDrawText(text, screenW * 0.8927, screenH * 0.8185, screenW * 0.9859, screenH * 0.8759, tocolor(254, 255, 255, 255), 1.25, "sans", "center", "top", false, true, false, false, false) addEventHandler("onClientPreRender",getRootElement(),dxText) setTimer(function() removeEventHandler("onClientPreRender",root,dxText) end,5000,1) end
  6. function teste() testestring = exports.mysql:_Query("SELECT * FROM characters JOIN users WHERE users.username = characters.username") if(testestring) then for i, string in ipairs(testestring) do iprint(testestring[i]) end end end addEventHandler("teste",getRootElement(),teste) Managed to figure it out, that will print all character data registered under that username thanks for helping me out
  7. Well i know it needs to load the data onto a table, because the result of loading it would have several rows with several variables. I don't know if i am explaining myself but this i am doing would possibly load several rows from mysql. However, i am not sure how LUA is loading them. I wanted it to load something like teststring[1][1] being first 1 the row and second 1 the variable inside the row. Like if you defined it like this: teststring = { {1,2,3,4,5}, {1,2,3,4,5}, {1,2,3,4,5}, {1,2,3,4,5}, {1,2,3,4,5} } BUT i want to know how it is loading the data from MySQL. That above was just an example, so i can later use the variables to load characters.
  8. Hey guys, So i made a relationship between my users database and the characters database and i currently got this on the code: teststring = exports.mysql:_QuerySingle("SELECT * FROM users JOIN characters ON (users.username = characters.username)") However if i would like to output it to the chat box how would i do it? Because we are joining two tables together, i don't know what to do anymore. Please someone help me? Best regards, Vasco
  9. So i see it now, i watched a video about it. However, how can i get all the characters saved after that in the code? Or any other tables data that i might need. Also, is this the best method for not wasting so much CPU resources?
  10. No i guess that is all. Really thanks for your help, apreciate it
  11. #table being the dbpoll or dbquery right?
  12. Well yea but, on a roleplay server i will need alot of stuff saved like vehicles and the global user data wich is used on all the players characters. I thought about making a table and adding all characters there with a column named "username" or "serial" and cross the player username and serial with the ones there. However how can i read a table top to bottom and get all the characters belonging to that player?
  13. It is not just the skins, i want several stuff stored. For each character i need about 20 variables or more.
  14. Hey guys, So i am doing a roleplay gamemode from scratch. However, i like to think about what i'm going to do and how i am going to do it before i even start. Obviously it would need a character system, however i don't see how i will link several characters to one account? How can i actually do it with MySQL? I currently got my login and register system done and i got a database with a users table set. Best regards, Vasco
×
×
  • Create New...