-
Posts
730 -
Joined
-
Last visited
-
Days Won
2
Everything posted by koragg
-
I think this will do the trick for you. https://community.multitheftauto.com/index.php?p=resources&s=details&id=9573 It saves the playtime to each player's account.
-
One thing for people wanting to install this. When you update your 1.5.2 to 1.5.3 and try to start it it will give error that a .dll file's missing. Google it, download it and put it in : MTA San Andreas\MTA folder. Then a message telling you to see some online help will pop up when you try to run the game again. Hit yes, download both things needed, install them and start MTA 1.5.3. Should be fine now.
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
I know you said it's backwards compatible but i wanna be sure. If i update my server with 1.5.3 files would 1.5.2 players be able to join still? Don't wanna update if I'm not sure, sorry
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
nice one
-
So time to report bugs 1. If I go to google, I can't open any link from there (just nothing happens, I guess it's same with all external links). 2. When I open youtube and minimize MTA the sound still continues, wouldn't it be better to link it to the MTA volume and when game minimized=sound muted? 3. Maybe make it possible for each client to set his own bookmarks (admin should set one main homepage for all)? That would be cool.
-
-
But strange thing is that on most maps it's fine, but on some like this one it isn't.
-
thanks, never knew I can use that instead of the 'round' function :v On normal sized cps (not huge) it says 4m when I'm infront of them (that's ok) but on bigger cps it says 20m, when I am literally infront of it. It is better than before though so thanks people
-
Got it to show like this but if on some cps it indeed shows close to 0 meters when I'm infront of them, on larger ones it still shows noticably bigger number --http://lua-users.org/wiki/FormattingNumbers function round(val, decimal) if (decimal) then return math.floor( (val * 10^decimal) + 0.5) / (10^decimal) else return math.floor(val+0.5) end end local sx_, sy_ = guiGetScreenSize ( ) local sx, sy = sx_/1440, sy_/900 function distanceFromPlayerToCheckpoint(player, i) g_Checkpoints = getAll("checkpoint") local checkpoint = g_Checkpoints[getElementData(player, "race.checkpoint")] if checkpoint == nil then return false end local x, y, z = getElementPosition(player) for i, v in ipairs(checkpoint) do outputChatBox(unpack(v)) end return getDistanceBetweenPoints3D(x, y, z, unpack(checkpoint.position)), unpack(checkpoint.size) end function getAll(name) local result = {} for i,element in ipairs(getElementsByType(name)) do result[i] = {} result[i].id = getElementID(element) or i local position = { tonumber(getElementData(element,"posX")), tonumber(getElementData(element,"posY")), tonumber(getElementData(element,"posZ")) } local size = { tonumber(getElementData(element, "size")) } result[i].position = position; result[i].size = size; end return result end function draw() local distance, size = distanceFromPlayerToCheckpoint(localPlayer) if distance and size then dxDrawText(distance-size.." m to next checkpoint", sx_ * 0.8734, sy_ * 0.2009, sx_ * 0.9510, sy_ * 0.2259, tocolor(254, 254, 34, 255), 1*sy, "default-bold", "center", "top", false, false, false, false, false) end end addEventHandler("onClientRender", root, draw) Also I can't seem to round the number.
-
Well, I replaced everything with yours.
-
Yea I noticed the size is nil, but why
-
attempt to perform aritmetic on local size a nil value
-
Tried this and while there are no errors, there is no distance now as well. local sx_, sy_ = guiGetScreenSize ( ) local sx, sy = sx_/1440, sy_/900 function draw() for k,v in ipairs(getElementsByType("player")) do local state = getElementData(v, "player state") if state == "Spectating" or state == "Away" or state == "Dead" or state == "Finished" or state == "Not Ready" then return end if distanceFromPlayerToCheckpoint(localPlayer) then distance = round(distanceFromPlayerToCheckpoint(localPlayer)) local cp = getElementByID("checkpoint") if cp then local size = getMarkerSize (cp) if size then local fix = distance - size dxDrawText(fix.." m to next checkpoint", sx_ * 0.8734, sy_ * 0.2009, sx_ * 0.9510, sy_ * 0.2259, tocolor(254, 254, 34, 255), 1*sy, "default-bold", "center", "top", false, false, false, false, false) end end end end end addEventHandler("onClientRender", root, draw)
-
Bump or no bump, if people don't know how it won't make any difference
- 18 replies
-
I haven't used that on gui elements yet (i have same thing as you on all gui things in my server) but it works same as with dxDrawText. Here's example: -if your current resolution is let's say 1920x1080 and you divide it by 1440x900 (that's my own example, same with what @Gravestone said) then the result will be more than 1, meaning the size of the element will get bigger, thus looking fine on FHD screens. -if your current resolution is for example 1280x720 then after dividing it with 1440x900 size of gui element gets smaller as 1280/1440 < 1 (720/900 < 1). -and yes, if you're using same resolution as the one on which you're dividing it to it will be exactly 1, so it will also look good on that resolution as well. *This doesn't work on 100% (does on 98% though) so if you have some things a bit misplaced play around with the number values of the gui position. Sometimes 19 isn't same as 20 (i mean it can make big difference) and even 19.8 can be better than 20.0 PS: sx and sy are just the easier way to use the method. You can divide width and height every time manually as well ... but why do it if you can just divide once above everything ? And then just use the defined variables sx and sy.
-
Nope, gave these errors.
-
g_Checkpoints = getAll("checkpoint") local checkpoint = g_Checkpoints[getElementData(player, "race.checkpoint")] local size = getMarkerSize ( checkpoint ) Can this work?
-
About the -15, isn't that different if cp size is bigger/smaller than the one on the pic?
-
Xiti said this on skype "You need then to subtraction the size of checkpoint to have at accurate" but I couldn't find anything relevant around Google, any thoughts?
-
Yes, it does work. Just one thing, is it in meters? Because when I'm right next to a cp it says "20". Down right side, red number under the HUD :
-
Not sure how to define it
-
I replaced *player* to *localPlayer but still same thing, draws "false" with no errors in debug.
-
Please use english around here so everybody understand you.
-
It draws "false" instead of distance with the following code. No errors in debug at all. local sx_, sy_ = guiGetScreenSize ( ) local sx, sy = sx_/1440, sy_/900 function distanceFromPlayerToCheckpoint(player, i) g_Checkpoints = getAll("checkpoint") local checkpoint = g_Checkpoints[i] if checkpoint == nil then return false end local x, y, z = getElementPosition(player) return getDistanceBetweenPoints3D(x, y, z, unpack(checkpoint.position)) end function getAll(name) local result = {} for i,element in ipairs(getElementsByType(name)) do result[i] = {} result[i].id = getElementID(element) or i local position = { tonumber(getElementData(element,"posX")), tonumber(getElementData(element,"posY")), tonumber(getElementData(element,"posZ")) } result[i].position = position; end return result end function draw() dxDrawText(tostring(distanceFromPlayerToCheckpoint(player, i)), sx_ * 1.5200, sy_ * 0.9843, sx_ * 0.2172, sy_ * 1.0167, tocolor(131, 253, 1, 255), 0.55*sy, "bankgothic", "center", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, draw) I did 'tostring' on line 30 as that's what it said in debug as the only error.
-
Yes but, how to make it output as dxdrawing? I tried adding dxdraw under the 'return' part and it started giving errors that g_Checkpoints[i] is undefined and stuff like that. Used this but still didn't work I think: g_Checkpoints = getAll("checkpoint")