-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Okay, nevermind, its working, but the randomly (normaly at 2nd or 3rd file), the download gets fucked up and fileOpen starts giving up errors. Why is this? local fileDownload = 0 local endingFile = 17 local fileName = "" addEventHandler('onClientResourceStart',resourceRoot, function() local file = fileOpen("wheelDownload.txt") if file then local size = fileGetSize(file) local txt = fileRead(file,size) if txt == "true" then else downloadFile("wheels/"..wheels[1].name..".dff") fileName = wheels[1].name fileDownload = 1 addEventHandler('onClientRender',root,drawLoad) end else downloadFile("wheels/"..wheels[1].name..".dff") fileName = wheels[1].name fileDownload = 1 addEventHandler('onClientRender',root,drawLoad) end end) local x,y = guiGetScreenSize() function drawLoad() dxDrawText("Downloading File: "..fileName..".dff", x*0.4,y*0.5,x*0.5,y*0.6,tocolor(255,255,255,255), 1.5, "default") local p = fileDownload/endingFile * (x*0.2) local file = fileOpen("wheels/"..fileName..".dff",true) if file then local size =fileGetSize(file) local size = math.floor(size/1000) outputConsole(size .. " / "..wheels[fileDownload].size) local psize = (size / wheels[fileDownload].size) * (x*0.2) dxDrawRectangle( x*0.4,y*0.55,psize,y*0.025,tocolor(0,0,0,255)) end dxDrawRectangle( x*0.4,y*0.6,p,y*0.025,tocolor(0,0,0,255)) end addEventHandler('onClientFileDownloadComplete',root,function(file,result) if result then fileDownload = fileDownload + 1 if fileDownload > 17 then removeEventHandler('onClientRender',root, drawLoad) local file = fileCreate("wheelDownload.txt") fileWrite(file, "true") fileClose(file) return end downloadFile("wheels/"..wheels[fileDownload].name..".dff") outputConsole(fileDownload) fileName = wheels[fileDownload].name else downloadFile("wheels/"..wheels[fileDownload].name..".dff") end end) greetz HyPeX
-
you need to open the file with fileOpen -- This works with text files only i belive.
-
Nono, i'm downloading files with downloadFile and i want to check progress, is there a way i can do this? (Of the file individually)
-
Hello, how can i retrive the size of a file client-sided? fileOpen wont work - its for text files Greetz HyPeX
-
I've disabled it, the camera is still taken away to a random spot in the air (Why??) and i'm not sure from where this is being done, wich function does this at NoMap?
-
Probably just coincidence, but it just looks extremly similar to another radar.. viewtopic.php?f=91&t=81689
-
I just know that shaders can be used to know that, i have zero knowledge with them, i'll leave someone more experienced answer that.
-
I removed all those things already, all the debbuging level i could get to, was to get a dark flashing when the race goes into state "NoMap". I cant find what can be related in the race to this - almost no function is affected. Search "NoMap" (3 hits in 2 files) C:\Juegos\Binaries\GTA MTA\MTA 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\racestates_server.lua (2 hits) Line 7: -- NoMap * No map loaded Line 195: if currentRaceStateName == 'NoMap' then return true end
-
Thats just drawing an image and moving it like you would do on a billboard/thingy. The only difficult part comes to apply it to the vehicle model like that.
-
Well, i'm not sure, but i always end up random guesses to get a good quality dxDrawText while in a custom font. Is there any way the system works? local font1 = dxCreateFont("fontbold.ttf",8) --- Lines later dxDrawText ('#1e90ffMap:', 3+1, screenHeight - dxGetFontHeight(1.00*scale, font1) , 100+1, 100+1, tocolor ( 0, 0, 0, 255 ),1.00*scale, font1, 'left','top',false,false,false,true,true,0)
-
I doubt it. mapmanager only switchs the map itself, loading another map does not turn the screen off... (Else, it would happen on resource start when they're loaded) Anyone with has any clue would be appreciated.
-
To clarify furthermore the issue, if i directly start the gamemode, it does load a map with no fades or anything, works perfectly. Upon changing map, it fades and cant disable it. If i restart the race, nothing happens. I must go back to some gamemode like play and then turn on back race to be able to see me again. Thanks for the idea about the hit, it'll be better than looping each file the next time.. But still, i'm totally stuck here...
-
Yeah, i already removed alot, this was my only hit: C:\Juegos\Binaries\GTA MTA\MTA 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\client_anim.lua (2 hits) Line 128: Fade in a picture: Line 133: Fade in a picture using a preset (for more presets, see the end of this file): C:\Juegos\Binaries\GTA MTA\MTA 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\countdown.lua (1 hit) Line 69: self.client.fade = enable C:\Juegos\Binaries\GTA MTA\MTA 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\countdown_client.lua (1 hit) Line 70: if self.fade then C:\Juegos\Binaries\GTA MTA\MTA 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\nametags.lua (1 hit) Line 24: -- Make the text a bit brighter and fade more gradually None of those are really relative with the issue i've got so far...
-
Well this is totally annoying me, i've removed every single line of fadeCamera of the race resource, yet the camera is still faded upon a map change?? Is there something i'm missing? Greetz EDIT: Apparently, its not a faceCamera (I cant turn it off via runcode), where in the race resource is there anything that makes a fade upon changing map?
-
Worked! Thanks! PD: Didnt remembered those args were passed as strings ^^
-
Whats up with that? i set the fps limit to 60 in the server via admin panel, mtaserver.conf is not easy to grab (vps server). is it really relative?
-
Well, its doing nothing, my FPS is still 53 if i set 60... no errors in debug server addEventHandler('onResourceStart', resourceRoot, function() setFPSLimit(0) end) client local fps = 53 addCommandHandler("sfps", function(cmd,val) if val then local val = math.floor(val) if val > 48 and val < 61 then setFPSLimit(val) else setFPSLimit(fps) end end end) addEventHandler('onClientResourceStart', resourceRoot, function() setFPSLimit(53) end)
-
I just got it, apparently the client side version of the function works pretty well Someone should mention in the wiki that this function includes the destruction of the element by themselves.. addEventHandler("onClientElementDestroy", getRootElement(), function () if getElementType(source) == "projectile" then if getProjectileType(source) == 19 then if not enabled then return end if Missiles[source] then Missiles[source].missile = nil destroyElement(Missiles[source].marker) Missiles[source].timer = nil Missiles[source] = nil end end end end)
-
Hello guys, i'm facing a problem, i cannot retrive whenever a projectile (rocket in this case), while colliding explodes, onClientExplosion retrives just the creator of the explosion, this does not involve the projectile itself... onElementDestroy -- Server side, does not include their self-destruction i couldnt find any more alternatives, checking onClientRender to loop throught all projectiles -- Projectile is destroyed before... Thanks in advance.
-
Np. Found out, images dont work out so well in MTA. i drawed a pure blank dot and set a color via tocolor part, and it worked like a charm.
-
Oh no, that just simply the image not being drawn fullly smooth to avoid lags...
-
So my issue is, the colours arent enought bright, thought i've already maxed out, the image drawn ingame with dxDrawImage is directly taken from the photoshopped image. you can see the photoshopped image in the left and ingame in the right. Code: dxDrawImage(cx-healthwidth/2,cy-healthwidth/2, healthwidth, healthwidth,"speedo/1health.png", i,0,0,tocolor(colorR,colorG,colorB,255),true) Is there anything i can do to draw an image like that? Greetz
-
Well i'm totally confused and i'm not sure how to continue this.. I'll try to explain my best what is the issue: Vehicles have max 1000HP. Under 250HP they get into fire. I'm making a Health bar. Under 250HP it should be actually 0. Whats my issue? My maths to draw the bar. My fast-fix was to get down those 250HP. Health = health-250 max = 750 local progress = Health/max The problem is, if you had 500HP. Aka 50%, on the new calculation you would have 250/750, wich doesnt shows 50%, and i'm not sure how to do this... local health = math.ceil( ( getElementHealth(veh) )) local max = 1000 local min = 0 local percentage = health/max if health >= 250 then health = health-250 max = 750 progress = health / max else progress = health / max end if health <= 0 then health = 0 end Greetz EDIT: I'm an idiot, didnt realize that actually 0.33 is right if you have 250HP of 750..
-
Thanks! thought i did the search with the text editor every file and didnt found it..
