-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Well, it says error on dbpoll: Error: Table '**dbname**.all_tables' doesnt exist! Database = dbConnect("mysql","dbname=**dbname**;host=IP", "user","pass") local query = dbQuery(Database, "SELECT `table_name` FROM `all_tables`") local result = dbPoll(query,-1) if result then for i,v in ipairs(result) do outputChatBox("Table Found! Name: "..v) end
-
Well, my question is quite simple, how can i recreate in MTA the background of this panel? (It is photoshopped). And aswell how to recreate the effects of pretty much everything else. I thought about an image as an easy one... but there might be a better method. Greetz http://www11.pic-upload.de/01.01.15/k59rogp98iuj.png
-
Should be pretty much the same as dxDrawImage?.. (Althought i dont belive .dds are aswell supported) https://wiki.multitheftauto.com/wiki/DxDrawImage Theorically if its like dxDrawImage, any image format should work. You should try thought.
-
Jeez, i'm not an idiot if i'm using already render targets, my fact is, i want the render target to cut anything outside itself. (i.e. the part of the rectangle wich is not inside).
-
Now, my first question, how can i make the draw only draw the exact box made by the render taget? dxSetRenderTarget(screen) local ax,ay = x*0.33,y*0.32 local fx,fy = x*0.373,y*0.36 local now = getTickCount() if now - start > 3000 then start = getTickCount() end local elapsed = now - start local progress = elapsed / 3000 local sx = interpolateBetween(0, 0,0,ax*0.2,0,0,progress,"Linear") dxDrawRectangle(0, 0, ax, ay,tocolor(100,100,100,180)) dxDrawRectangle(-50+fx, ay*0.5+fy, ax*0.2,ay*0.05,tocolor(0,0,0,255),true) dxSetRenderTarget() dxDrawImage(x*0.373,y*0.36,x*0.33,y*0.32,screen,0,0,0,tocolor(255,255,255,255))
-
Oh Lol. Thanks! worked.
-
The fact is i'm already drawing it after the gray rectangle - thats why it makes my mad as it doesnt go on top
-
And another issue: I cant make by any means make the black rectangle be drawn on top.. local x,y = guiGetScreenSize() local screen = dxCreateRenderTarget(x*0.33,y*0.32,true) local start = getTickCount() addEventHandler('onClientRender',root,function() dxSetRenderTarget(screen) local ax,ay = x*0.33,y*0.32 local fx,fy = x*0.373,y*0.36 local now = getTickCount() if now - start > 3000 then start = getTickCount() end local elapsed = now - start local progress = elapsed / 3000 local sx = interpolateBetween(0, 0,0,ax*0.2,0,0,progress,"Linear") dxDrawRectangle(0, 0, ax, ay,tocolor(100,100,100,180)) dxDrawRectangle(ax*0.2+fx, ay*0.5+fy, ax*0.2,ay*0.05,tocolor(0,0,0,255),true) dxSetRenderTarget() dxDrawImage(x*0.373,y*0.36,x*0.33,y*0.32,screen,0,0,0,tocolor(255,255,255,255),true) dxDrawRectangle(x*0.373,y*0.33, x*0.33, y*0.029,tocolor(50,50,50,255)) end,true,"high+6")
-
Well, the rectangle is somehow being drawn outside the render target... is there a way to make anything outside the render target to be cut off? local x,y = guiGetScreenSize() local screen = dxCreateRenderTarget(x*0.33,y*0.32,true) local start = getTickCount() addEventHandler('onClientRender',root,function() dxSetRenderTarget(screen) local ax,ay = x*0.33,y*0.32 local fx,fy = x*0.373,y*0.36 outputChatBox(ax*0.2 + fx.." "..fx) local now = getTickCount() if now - start > 3000 then start = getTickCount() end local elapsed = now - start local progress = elapsed / 3000 local sx = interpolateBetween(-ax*0.2, 0,0,ax*0.2,0,0,progress,"Linear") dxDrawRectangle(sx+fx, ay*0.5+fy, ax*0.2,ay*0.05,tocolor(0,0,0,255),true) --dxDrawRectangle(0, 0, ax, ay,tocolor(100,100,100,255)) dxSetRenderTarget() dxDrawImage(x*0.373,y*0.36,x*0.33,y*0.32,screen,0,0,0,tocolor(255,255,255,255),true) dxDrawRectangle(x*0.373,y*0.33, x*0.33, y*0.029,tocolor(50,50,50,255)) end,true,"high+6")
-
Hello guys, i was told shaders were something really usefull for drawing things. My issue is - i've readed https://wiki.multitheftauto.com/wiki/Element/Shader - but i almost came to no conclusion / idea of what to do or how to use them. So my question is if there is any good tutorial or site i can relate to this to start learning on shaders. Thanks in advance.
-
Sorry for the delay gallardo - im on vacations away till tomorrow. As ive just been told, the mysql is hosted in a custom mysql website - www.wedos.cz So, so far the forum details should work good?
-
Pretty much it is giving the error "Could not connect". Thought i'm selecting the exact values.. (The forum is hosted in a separate VPS) (i replaced the user & pass with *) script: Database = dbConnect("mysql","dbname=d69588_forumm;host=wm61.wedos.net", "***","***","share=1") php: $INFO['sql_host'] = 'wm61.wedos.net'; $INFO['sql_database'] = 'd69588_forumm'; $INFO['sql_user'] = '***'; $INFO['sql_pass'] = '***';
-
You defined it when you created your IPB forum. (MySQL login, password, database, prefix) As far as I remember, there should be a config.php in the folder of your site with all the required details. P.S. Happy new year I didnt created the forum so i guess i'll search for the config.php file in the FTP... Happy new year aswell and thanks a lot!
-
Okay so i think i got a pretty clear idea, now my last issue would be, How can i find IPB's mysql database details? (password, username, etc) Thanks a lot.
-
Thats seems fine and i'll test it for logging in. - But what about adding/retriving data to their accounts? do i need to hash anything or i can just run data to their account like if it was a mysql common database? And also, when looping throught IPB mysql table - usernames are just saved without hashing and under wich value? Thanks! EDIT: How do i define salt? EDIT2: How is mysql database saved in IPB? Should i just connect to the webpage's IP on wich port?
-
It is, in fact right.... if wheels[fileDownload+1] then outputConsole( type( wheels[fileDownload+1] ) ) outputConsole(wheels[fileDownload+1]) downloadFile("wheels/"..wheels[fileDownload+1].name..".dff") fileName = wheels[fileDownload + 1].name fileDownload = fileDownload + 1 else return end Second test: if wheels[fileDownload+1] then outputConsole( type( wheels[fileDownload+1] ).name ) outputConsole(wheels[fileDownload+1].name) downloadFile("wheels/"..wheels[fileDownload+1].name..".dff") fileName = wheels[fileDownload + 1].name fileDownload = fileDownload + 1 else return end
-
Bump, i've discovered a quick teleport away of the camera in fact wont disable the camera - it justs lags when it TPs back to the vehicle in the new map, but it doesnt fades. There's something causing a fade itself - and i dont know what.
-
if wheels[fileDownload+1] then downloadFile("wheels/"..wheels[fileDownload+1].name..".dff") fileName = wheels[fileDownload + 1].name fileDownload = fileDownload + 1 else return end Its weird, it still gives me errors. But whats most strange, is that the error only happens exactly the half of the times. I.e if i turn it off and start it again it will work...
-
Hello everyone, i'm using IPB Forum as my main start for everyting wich is going to start in the server. My problem is the functions IPB uses - How do i call them? .php file: <?php require( "initdata.php"); require( "hypexmta/sdk/mta_sdk.php" ); require( "admin/sources/base/ipsRegistry.php" ); require( "admin/sources/loginauth/login_core.php" ); require( "admin/sources/loginauth/interface_login.php" ); ipsRegistry::init(); $table = mta::getInput(); $text = $table[1]; if(isset($text)){ $returning = authenticate(table[0], "", table[1]); mta::doReturn($returning); } My issue is, i dont know wich is the function for logging in a member - Checking their data,( as it was stated MTA cant de-hash all IPB's hashes placed on its Mysql database) setting a custom data and later on retriving it. I have zero knowledge on php, so its kind of hard for me to come up with anything at all pretty much. Thanks in advance.
-
Yeah, the error is given becouse there's no index 18, but if you look the script, you'll realize there's no reason for the script to reach ever index 18 - it should be stopped before.
-
You're missing the dynamic part dxGetTextWidth
-
Bump, i'm totally ragging all over this script, somehow, half the times i start it it fails loading... When it fails it spams debugscript a lot of times, and then it stops giving errors... (Until it stops giving errors it lags a lot, but its just 1-2 sec) Console: n..117 Error debugscript 3: .lua:line 194: attemt to index field '?' (a nil value) local wheels = {} wheels[1] = {name="wheel_or1",id=1025,size=370} wheels[2] = {name="wheel_sr6",id=1073,size=412} wheels[3] = {name="wheel_sr3",id=1074,size=340} wheels[4] = {name="wheel_sr2",id=1075,size=364} wheels[5] = {name="wheel_lr4",id=1076,size=368} wheels[6] = {name="wheel_lr1",id=1077,size=356} wheels[7] = {name="wheel_lr3",id=1078,size=384} wheels[8] = {name="wheel_sr1",id=1079,size=366} wheels[9] = {name="wheel_sr5",id=1080,size=372} wheels[10] = {name="wheel_sr4",id=1081,size=358} wheels[11] = {name="wheel_gn1",id=1082,size=386} wheels[12] = {name="wheel_lr2",id=1083,size=370} wheels[13] = {name="wheel_lr5",id=1084,size=370} wheels[14] = {name="wheel_gn2",id=1085,size=370} wheels[15] = {name="wheel_gn3",id=1096,size=364} wheels[16] = {name="wheel_gn4",id=1097,size=368} wheels[17] = {name="wheel_gn5",id=1098,size=360} local fileDownload = 0 local endingFile = 17 local fileName = "" addEventHandler('onClientResourceStart',resourceRoot, function() if fileExists("wheelDownload.txt") then local file = fileOpen("wheelDownload.txt") local size = fileGetSize(file) local txt = fileRead(file,size) fileClose(file) if txt == "true" then downloadTxd() else for i,v in ipairs(wheels) do local result = fileExists("wheels/"..v.name..".txt") if result then fileDownload = fileDownload + 1 if fileDownload > 16 then local sfile = fileCreate("wheelDownload.txt") fileWrite(sfile, "true") fileClose(sfile) downloadTxd() return end end end if fileDownload >= 1 then downloadFile("wheels/"..wheels[fileDownload].name..".dff") fileName = wheels[fileDownload].name addEventHandler('onClientRender',root,drawLoad) outputConsole("Y..1"..fileDownload) else fileDownload = 1 downloadFile("wheels/"..wheels[fileDownload].name..".dff") fileName = wheels[fileDownload].name addEventHandler('onClientRender',root,drawLoad) outputConsole("Y..2"..fileDownload) end end else for i,v in ipairs(wheels) do local result = fileExists("wheels/"..v.name..".txt") if result then fileDownload = fileDownload + 1 if fileDownload > 16 then local sfile = fileCreate("wheelDownload.txt") fileWrite(sfile, "true") fileClose(sfile) downloadTxd() return end end end if fileDownload >= 1 then downloadFile("wheels/"..wheels[fileDownload].name..".dff") fileName = wheels[fileDownload].name addEventHandler('onClientRender',root,drawLoad) outputConsole("n..1"..fileDownload) else outputConsole("n..2"..fileDownload) fileDownload = 1 downloadFile("wheels/"..wheels[fileDownload].name..".dff") fileName = wheels[fileDownload].name addEventHandler('onClientRender',root,drawLoad) end end end) local x,y = guiGetScreenSize() -- [[ MATHS SHIT ]] -- local barx = 305 local ox = 1920 local xsize = (barx / 1920) * x local bary = 27 local oy = 1080 local ysize = (bary / 1080) * y local mx = (808/1920)*x local my = (944/1080)*y local my2 = (4/1080)*y local boxx = 44 local xbox = (boxx / 1920) * x local boxy = 33 local ybox = (boxy / 1080) * y local tenx = (10/1920) * x local font0 = dxCreateFont("fontdefault.ttf", 10) local font1 = dxCreateFont("fontbold.ttf", 10) local font2 = dxCreateFont("fontdefault.ttf", 11) function drawLoad() local total = 0 local current = 0 for i=1, 17 do total = total + wheels[i].size if i < fileDownload then current = current + wheels[i].size end end if fileExists("wheels/"..fileName..".dff") then local file = fileOpen("wheels/"..fileName..".dff",true) local size =fileGetSize(file) fileClose(file) local size = math.floor(size/1000) local progress = ((size + current)/ total) local oR,oG,oB = 68,160,197 local nR,nG,nB = 136,206,170 local slice = (xsize - (tenx*2)) / 100 for i=1, 100 do if i >= math.floor(progress*100) then else local r,g,b = interpolateBetween(oR,oG,oB,nR,nG,nB,i/100,"Linear") dxDrawImage(mx + tenx + (slice * (i-1)),my + ysize/2-my2/4,slice,my2,"loading/progress.png",0,0,0, tocolor(r,g,b,255)) end end dxDrawImage( mx +tenx + (slice * (progress*100)) - (xbox / 2), (924/1080)*y, xbox, ybox, "loading/box.png", 0,0,0,tocolor(255,255,255,255)) dxDrawText( math.floor((progress*100)).."%",mx +tenx + (slice * (progress*100))-xbox, (924/1080)*y, mx +tenx + (slice * (progress*100)) + xbox, (924/1080)*y + ybox,tocolor(255,255,255,255), 1.00, font1, "center", "center") dxDrawImage( mx,my,xsize,ysize,"loading/bar.png",0,0,0,tocolor(255,255,255,255))dxDrawImage( mx,my,xsize,ysize,"loading/bar.png",0,0,0,tocolor(255,255,255,255)) local width = dxGetTextWidth("current file: ", 1, font0) dxDrawText("current file: ", (888/1920)*x,(971/1080)*y,x*1,y*1,tocolor(255,255,255,255), 1, font0) dxDrawText(fileName..".dff", (888/1920)*x+width,(971/1080)*y,x*1,y*1,tocolor(255,255,255,255), 1, font1) end if wheelstxd then if fileExists("wheels/wheels.txd") then local file = fileOpen("wheels/wheels.txd",true) local size =fileGetSize(file) fileClose(file) local size = math.floor(size/1000) local progress = (size/ 6767) dxDrawText("Downloading File: "..fileName..".txd", x*0.05,y*0.5,x*0.5,y*0.6,tocolor(255,255,255,255), 1.5, "default") end end end c = nil addEventHandler('onClientFileDownloadComplete',root,function(file,success) if file == "wheels/wheels.txd" then if success then loadWheels() sfile = fileCreate("wheels/wheels.txd") fileWrite(sfile,"true") fileClose(sfile) else downloadFile("wheels/wheels.txd") end end if ( success == true ) then c = nil for i,v in ipairs(wheels) do if (file) == ("wheels/"..v.name..".dff") then c=true end end if not c then return end local sfile = string.gsub(file, ".dff", "") local sfile = fileCreate(sfile..".txt") fileWrite(sfile, "true") fileClose(sfile) if fileDownload > 16 then removeEventHandler('onClientRender',root, drawLoad) local sfile = fileCreate("wheelDownload.txt") fileWrite(sfile, "true") fileClose(sfile) downloadTxd() return end a = nil downloadFile("wheels/"..wheels[fileDownload+1].name..".dff") fileName = wheels[fileDownload + 1].name fileDownload = fileDownload + 1 end end) function downloadTxd() if not fileExists("wheels/wheels.txt") then downloadFile("wheels/wheels.txd") else loadWheels() end end function loadWheels() txd = engineLoadTXD("wheels/wheels.txd") for i,v in ipairs(wheels) do engineImportTXD(txd, v.id) dff = engineLoadDFF("wheels/"..v.name..".dff") engineReplaceModel(dff,v.id) end end
-
interpolateBetween
-
Well, this is quite weird, it should never get past 17, but it reaches 18 and stays there.... if fileDownload > 16 then removeEventHandler('onClientRender',root, drawLoad) local sfile = fileCreate("wheelDownload.txt") fileWrite(sfile, "true") fileClose(sfile) return end a = nil outputConsole("downloading.. ["..fileDownload + 1 .."] ".."wheels/"..wheels[fileDownload+1].name..".dff") downloadFile("wheels/"..wheels[fileDownload+1].name..".dff") outputConsole(fileDownload + 1) fileName = wheels[fileDownload + 1].name fileDownload = fileDownload + 1 Console: 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18
