-
Posts
1,255 -
Joined
-
Last visited
Everything posted by .:HyPeX:.
-
Tried it. clear = dxCreateFont("fonts/clear.ttf", 8*6.5) -- dxDrawText("Test Text", x*0.4,y*0.5,x,y,tocolor(255,255,255,255),6.1,"clear","left","top",false,false,true,true,true) dxDrawText("Test Text", x*0.4,y*0.65,x,y,tocolor(255,255,255,255),1,clear,"left","top",false,false,true,true,true) http://i.imgur.com/dngxsVj.jpg I would still give the point to MTA's default. (Upper one)
-
Thanks for the advice, i'll see if i can actually do anything on this. By the way, dxCreateFont("default", scale,true) would work? Else i dont know how to set actually a more exact value with decimal scaling in the dxDraw itself I'll update this. You seem to actually be right. Custom fonts actually suck. They're both the exact same font and size. MTA's hardcoded one rocked over the custom one. In-game the difference is even more devastating. http://i.imgur.com/1YAa5Ge.jpg default = dxCreateFont("fonts/normal.ttf", -- s8) --> --[[ Stuff ]] dxDrawText("Test Text", x*0.5,y*0.65,x,y,tocolor(255,255,255,255),2.5,"default") dxDrawText("Test Text", x*0.5,y*0.5,x,y,tocolor(255,255,255,255),2.5,default) Now i came across the point we discussed on scaling on perfect positions - i posted a topic about the math issue involved. viewtopic.php?f=91&t=84253 Thanks to you all guys. EDIT: Even more devastating results. i enabled sub-pixel positioning for this one. http://i.imgur.com/FJ8E53b.jpg EDIT2: Tried with verdana, the font by excelence with most clear results. http://i.imgur.com/IKpBUNq.jpg PD: For the record, i'm taking the fonts out directly from window's library, so good quality in the .ttf file can be asumed.
-
Well if anyone gets to how do this... please tell me, i'm trying but cant find any way. My issue: I draw a custom font in 1.0 scale. Ok. The custom font size is defined by a function wich scales on the screen relatives. Ok. I've found out, the drawing quality is better if you use exact values in the end size. (Scale 1.0 and an exact value of font, like 10) Now, how do i draw this with a default font from mta? i cannot re-create them as they're hardcoded and i dont know how to calculate correctly the size. The main issue is, the dxDrawText wiki page does not say the font's default size they're created on. For the sake of the test, i tried verdana, got a custom font created it and compared. This is the list i could find: Clear: Verdana 8pt. default: Tahoma 8pt (After that i assume every font is in 8pt.) Now, if i need to make up scaling with every font to make a clear answer, how could i? This was my example, but not a working thing that could actually be used: local scale = 8 local scaleMultiplier = 1-- Its what i get from my custom function, never fails, always gives correct multiplier. (It also gives decimals... on ~0.01 error. -- My assume was this actually... -- If we want to get a 12pt size we would do: local endScaling = 12 / 8 local fixingScale = endScaling * scaleMultiplier -- This would be my scale in the drawing function local scale = fixingScale * scale -- This would be the result output visually -- This is a nice way and it works, but my issue is now, how do i get to always write exact font sizes? (8,9,10,11 pt) since this gives better quality. -- and my mind is apparently not capable of finding a work arround for this.
-
Thanks for the advice, i'll see if i can actually do anything on this. By the way, dxCreateFont("default", scale,true) would work? Else i dont know how to set actually a more exact value with decimal scaling in the dxDraw itself
-
I'm always using my own custom fonts, this option will afect custom fonts aswell? For the record, they're pt sans bold/default.
-
i tried drawing a high quality render target aswell, the quality is the same while drawing. (Even a bit worse possibly, as render targets arent so good for texts) Subpixelpositioning didnt return any noticeable change either..
-
I was coming as that as a temporary solution already, but it is still not greatest quality.. I'll look into dealman's part about the aspect ratio.. that should actually play a role, as my friend with 1920x1080 screen sees the texts "HD" while my 1360x768 widescreen doesnt so good. http://prntscr.com/5s57i5 1360x768 http://prntscr.com/5s58hd 1280x720 http://prntscr.com/5s57sw 800x600 http://prntscr.com/5s5844 640x480
-
Before anything please sustain from answering without some knowledge/testing. I'm already at my nerves becouse of this. My only basic problem in this simple world, is having a good quality small-size text. I can already make the text fit exactly the size in every resolution. (Resizing according to screen relatives is perfect in other words). But i cannot find any way to draw the text in good quality. Tried using a render target to make the text look good quality and then draw as an image to avoid quality loss - Still bad results when drawn small Tried using screen relative values directly (Yeah, fuck perfect resizing) - Bad results Fixed values - Not an option for smaller resolutions, text would get out of positions This is a photoshop output - Veery small size, yet good quality: http://i.imgur.com/2JLCgma.png (Please Note MTA's screen output is a bit sucky, somehow MTA doesnt get a good text imaging, you will notice a bit of blur arround the texts) This is a MTA output - a bit larger size - and horrible quality - Using a big screen size: http://i.imgur.com/lHvx3iL.jpg This is MTA output - Smallest resolution - 640x480 - horrible quality (Barely readable): http://i.imgur.com/RE5xSMB.png So, is there anyone out there who has managed any way to get a good quality text? i'm already about to explode in anger on this subject.
-
Well, i guess i found some errors.. 2015-01-11 00:11:50] CONNECT: Emp/#0fc366~HyPeX~ connected (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442 Version: 1.4.0-9.06985.0) [2015-01-11 00:11:51] JOIN: Emp/#0fc366~HyPeX~ joined the game (IP: 181.31.38.23) [2015-01-11 00:11:51] WARNING: joinquit/infobox_s.lua:225: Bad argument @ 'setElementData' [Expected bool at argument 4, got string 'AR'] [2015-01-11 00:12:09] LOGIN: Emp/#0fc366~HyPeX~ tried to log in as 'hypex' with an invalid password (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442) [2015-01-11 00:12:13] LOGIN: (CW, Admin, Everyone) Emp/#0fc366~HyPeX~ successfully logged in as 'hypex' (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442) [2015-01-11 00:12:17] restart: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:12:17] Stopping race [2015-01-11 00:12:17] INFO: Resource stopping [2015-01-11 00:12:17] Stopping killmessages [2015-01-11 00:12:17] Stopping [DM]SazukEv6 [2015-01-11 00:12:17] Starting race [2015-01-11 00:12:17] Starting killmessages [2015-01-11 00:12:17] INFO: Race resource starting [2015-01-11 00:12:17] INFO: Race onGamemodeStart [2015-01-11 00:12:17] Gamemode 'Race' started. [2015-01-11 00:12:17] race restarted successfully [2015-01-11 00:12:17] Starting [DM]SazukEv6 [2015-01-11 00:12:17] INFO: onGamemodeMapStart([DM]SazukEv6) [2015-01-11 00:12:18] Map '[DM]SazukE# v6^ Deep in the Dark' started. [2015-01-11 00:12:18] startResource: Resource '[DM]SazukEv6' started [2015-01-11 00:12:18] INFO: Loaded race mode Destruction derby [2015-01-11 00:12:23] SCRIPT: Emp/#0fc366~HyPeX~(hypex) set his script debug mode to 3 [2015-01-11 00:12:33] restart: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:12:33] Stopping race [2015-01-11 00:12:33] INFO: Resource stopping [2015-01-11 00:12:33] Stopping killmessages [2015-01-11 00:12:33] Stopping [DM]SazukEv6 [2015-01-11 00:12:33] Starting race [2015-01-11 00:12:33] Starting killmessages [2015-01-11 00:12:33] INFO: Race resource starting [2015-01-11 00:12:33] INFO: Race onGamemodeStart [2015-01-11 00:12:33] Gamemode 'Race' started. [2015-01-11 00:12:33] race restarted successfully [2015-01-11 00:12:33] Starting [DM]PeiN-Ft-Micra_-_Lethal_Weapon [2015-01-11 00:12:34] INFO: onGamemodeMapStart([DM]PeiN-Ft-Micra_-_Lethal_Weapon) [2015-01-11 00:12:35] Map '[DM] PeiN ft. Micra - Lethal Weapon' started. [2015-01-11 00:12:35] startResource: Resource '[DM]PeiN-Ft-Micra_-_Lethal_Weapon' started [2015-01-11 00:12:35] INFO: Loaded race mode Destruction derby [2015-01-11 00:12:41] start: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:12:41] Starting Login [2015-01-11 00:12:43] LOGOUT: Emp/#0fc366~HyPeX~ logged out as 'hypex' [2015-01-11 00:12:48] LOGIN: (CW, Admin, Everyone) Emp/#0fc366~HyPeX~ successfully logged in as 'hypex' (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442) [2015-01-11 00:12:48] ERROR: [EMP]/[race]/race/modes/base.lua:368: bad argument #2 to 'random' (interval is empty) [2015-01-11 00:12:48] WARNING: [EMP]/[race]/race/race_server.lua:1286: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got resource] -- BIG SPAM OF THIS ERROR -- [2015-01-11 00:13:41] stop: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:13:41] Stopping race [2015-01-11 00:13:41] INFO: Resource stopping [2015-01-11 00:13:41] Stopping killmessages [2015-01-11 00:13:41] Stopping [DM]PeiN-Ft-Micra_-_Lethal_Weapon [2015-01-11 00:13:44] start: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:13:44] Starting race [2015-01-11 00:13:44] Starting killmessages [2015-01-11 00:13:44] INFO: Race resource starting [2015-01-11 00:13:44] INFO: Race onGamemodeStart [2015-01-11 00:13:44] Gamemode 'Race' started. [2015-01-11 00:13:45] Starting KiwiVol7 [2015-01-11 00:13:45] INFO: onGamemodeMapStart(KiwiVol7) [2015-01-11 00:13:45] Map '[DM] Kiwi Vol.7 - Perception' started. [2015-01-11 00:13:46] startResource: Resource 'KiwiVol7' started [2015-01-11 00:13:46] INFO: Loaded race mode Destruction derby [2015-01-11 00:14:11] Stopping KiwiVol7 [2015-01-11 00:14:12] Starting DM-Skaarj-Vol11-Falling-Feathers [2015-01-11 00:14:13] INFO: onGamemodeMapStart(DM-Skaarj-Vol11-Falling-Feathers) [2015-01-11 00:14:14] Map '[DM] Skaarj vol.11 - Falling Feathers' started. [2015-01-11 00:14:14] startResource: Resource 'DM-Skaarj-Vol11-Falling-Feathers' started [2015-01-11 00:14:15] INFO: Loaded race mode Destruction derby [2015-01-11 00:15:07] QUIT: Emp/#0fc366~HyPeX~ left the game [Quit] [2015-01-11 00:15:07] INFO: Stopping map [2015-01-11 00:15:42] CONNECT: Emp/#0fc366~HyPeX~ connected (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442 Version: 1.4.0-9.06985.0) [2015-01-11 00:15:47] JOIN: Emp/#0fc366~HyPeX~ joined the game (IP: 181.31.38.23) [2015-01-11 00:15:47] WARNING: joinquit/infobox_s.lua:225: Bad argument @ 'setElementData' [Expected bool at argument 4, got string 'AR'] [2015-01-11 00:16:01] LOGIN: (CW, Admin, Everyone) Emp/#0fc366~HyPeX~ successfully logged in as 'hypex' (IP: 181.31.38.23 Serial: F27CCCFAB293B848763C115C76C09442) [2015-01-11 00:16:03] INFO: No map loaded; showing votemanager [2015-01-11 00:16:08] Stopping DM-Skaarj-Vol11-Falling-Feathers [2015-01-11 00:16:09] Starting [DM]CooLftCosa_Nostra-New-Island [2015-01-11 00:16:10] INFO: onGamemodeMapStart([DM]CooLftCosa_Nostra-New-Island) [2015-01-11 00:16:10] Map '[DM] CooL ft. Cosa_Nostra - New Island' started. [2015-01-11 00:16:10] startResource: Resource '[DM]CooLftCosa_Nostra-New-Island' started [2015-01-11 00:16:11] INFO: Loaded race mode Destruction derby [2015-01-11 00:16:11] SCRIPT: Emp/#0fc366~HyPeX~(hypex) set his script debug mode to 3 [2015-01-11 00:16:19] restart: Requested by Emp/#0fc366~HyPeX~(hypex) [2015-01-11 00:16:19] Stopping race [2015-01-11 00:16:19] INFO: Resource stopping [2015-01-11 00:16:19] Stopping killmessages [2015-01-11 00:16:20] Stopping [DM]CooLftCosa_Nostra-New-Island [2015-01-11 00:16:20] Starting race [2015-01-11 00:16:20] Starting killmessages Line 1286 from server: (line 18 here) TimerManager.createTimerFor("raceresource","warppeds"):setTimer( function () -- Make sure all players are in a vehicle local maxCheck = 6 -- Max number to check per call local maxWarp = 3 -- Max number to warp per call local warped = 0 for checked = 0, #g_Players - 1 do if checked >= maxCheck or warped >= maxWarp then break end g_checkPedIndex = g_checkPedIndex + 1 if g_checkPedIndex > #g_Players then g_checkPedIndex = 1 end local player = g_Players[g_checkPedIndex] if not getPedOccupiedVehicle(player) then local vehicle = g_Vehicles[player] if vehicle and isElement(vehicle) and not isPlayerRaceDead(player) then outputDebugString( "Warping player into vehicle for " .. tostring(getPlayerName(player)) ) warpPedIntoVehicle( player, vehicle ) warped = warped + 1 end end end end, 50,0 ) Line 368 from Base: (Line 6 here) local g_DoubleUpPos = 0 function RaceMode:pickFreeSpawnpoint(ignore) -- Use the spawnpoints from #1 to #numplayers as a pool to use local numToScan = math.min(getPlayerCount(), #g_Spawnpoints) -- Starting at a random place in the pool... local scanPos = math.random(1,numToScan) -- ...loop through looking for a free spot for i=1,numToScan do local idx = (i + scanPos) % numToScan + 1 if hasSpaceAroundSpawnpoint(ignore,g_Spawnpoints[idx], 1) then return g_Spawnpoints[idx] end end -- If one can't be found, find the spot which has the most space local bestSpace = 0 local bestMatch = 1 for i=1,numToScan do local idx = (i + scanPos) % numToScan + 1 local space = getSpaceAroundSpawnpoint(ignore,g_Spawnpoints[idx]) if space > bestSpace then bestSpace = space bestMatch = idx end end -- If bestSpace is too small, assume all spawnpoints are taken, and start to double up if bestSpace < 0.1 then g_DoubleUpPos = ( g_DoubleUpPos + 1 ) % #g_Spawnpoints bestMatch = g_DoubleUpPos + 1 end return g_Spawnpoints[bestMatch] end When i tried with a friend (Made the race restart and work with me already in) when he logged in, he was still as "Joined".
-
Just do a constant onClientRender veh = nil if getElementData(getLocalPlayer(), "state") == "alive" then if isElement(getCameraTarget(getLocalPlayer())) and getElementType(getCameraTarget(getLocalPlayer())) == "vehicle" then veh = getCameraTarget(getLocalPlayer()) end elseif getElementData(getLocalPlayer(), "state") == "dead" then if isElement(getCameraTarget(getLocalPlayer())) and getElementType(getCameraTarget(getLocalPlayer())) == "vehicle" then veh = getCameraTarget(getLocalPlayer()) end elseif getElementData(getLocalPlayer(), "state") == "waiting" then if getCameraTarget(getLocalPlayer()) then if isElement(getCameraTarget(getLocalPlayer())) and getElementType(getCameraTarget(getLocalPlayer())) == "vehicle" then veh = getCameraTarget(getLocalPlayer()) end end end -- OVERRIDE SPECTATING WHILE ALIVE if getCameraTarget(getLocalPlayer()) then if getElementType(getCameraTarget(getLocalPlayer())) == "vehicle" then veh = getCameraTarget(getLocalPlayer()) end end if not veh then return end
-
What fires onClientMapStarting? so i check what is not being actually fired. (Tracking down the bug)
-
Well i got a bug, when i enabled it on my custom race it fails to work properly (Thought on default one works like a charm..) The fact is, when i log in the race loads the map, (it does the countdown and then travelling) But race does not load the map properly, the map name stats as N/A, and the map is not started at all. (Event onClientMapStarting isnt fired). Forcing another map doesnt work. Restarting the race fixes the issue. (If you're already logged in it does fire your resource start) The only real difference i noticed is that the default race had the votemanager part. (Selecting the map out of 9). No debug errors.
-
Its working now. Thanks
-
it still gives the same error :&
-
i was trying to fire it from the server side, apparently client-side worked. Thanks.
-
E: Unable to locate package libmysqlclient16
-
You may delete the cp'ied libmysql befeore typing this commands apt-get update apt-get upgrade apt-get install libmysqlclient16 How to? i'm not the main owner of the VPS nor the one who sets it up, and know some basic things like managing the servers, but not much more. (I got full acccess thought)
-
Hey guys, wich is the proper way to remove the race client bootop? I want to create a login panel, but the race kicking in is kinda annoying, how can i delay it properly and then start it back up? (Wich evens i must edit). all my tries ended up in race loading in mode freeroam and bugging...
-
RROR: Could not load root/mta-developingsw/mods/deathmatch/./dbconmy.so - libmysqlclient.so.16: wrong ELF class: ELFCLASS64
-
The exact file is there..
-
ERROR: Could not load root/mta-developingsw/mods/deathmatch/./dbconmy.so - libmysqlclient.so.16:cannot open shared object file: no such file or directory. Its a linux debian 3.2.54-2 x86_64 vps by the way.
-
Well this is quite weird, i cannot access the mysql from the same VPS but i can from my PC. I.e, i did the script in my PC, tested it and worked. Moved it to the VPS server, and the script fails. Tested aswell with localhost adress. (127.0.0.1). Still not working. What could cause this? PD: Its not a rights error, tested in both sides giving admin rights.
-
Oh i'm an idiot, i didnt set the password field..
-
Hello, so far apparently hash is unsuccessful. Apparently there's also a "members_pass_hash" field (according to mysql database) function lowermd5(val) return string.lower(md5(val)) end salt = "" password = "" username = "user" local hash = "pass" Database = dbConnect("mysql","***;host=***", "***","***") addEventHandler('onResourceStart',resourceRoot,function() local query = dbQuery(Database, "SELECT members_pass_salt,member_login_key,members_pass_hash FROM members WHERE name='"..username.."'") --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 for _,row in ipairs(result) do for column, value in pairs ( row ) do outputConsole(column.. " " ..value) if column == "members_pass_salt" then salt = value outputChatBox("Salt Retrived") elseif column == "member_login_key" then password = value elseif cloumn == "members_pass_hash" then mysqlhash = value end -- value = the value of that column in this certain row end end runHash() else outputChatBox("DB Query Failed") end end) function runHash() local hash = lowermd5(lowermd5(salt)..lowermd5(password)) if hash == mysqlhash then outputChatBox("Hash successful") else outputChatBox("Hash unsuccessful") end end members_pass_hash b8d93637ad8abd6e0201003678da0111 member_login_key c943cee0017aa8f1a1e8a9750904736f members_pass_salt G!iz! Salt Retrived Hash unsuccessful EDIT: Ran some tests.. function runHash() outputConsole(lowermd5(salt).." "..lowermd5(password)) outputConsole(lowermd5(lowermd5(salt)..lowermd5(password))) local hash = lowermd5(lowermd5(salt)..lowermd5(password)) outputConsole(hash.." == "..mysqlhash) if hash == mysqlhash then outputChatBox("Hash successful") else outputChatBox("Hash unsuccessful") end end bf4bfa3a257801dcb7ef8a2bba26bec6 d41d8cd98f00b204e9800998ecf8427e 3cbf7f5d17b17431099e2f5fabddc692 3cbf7f5d17b17431099e2f5fabddc692 == b8d93637ad8abd6e0201003678da0111 Hash unsuccessful
