-
Posts
1,031 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Bonsai
-
Could you explain that?
-
Like, overall? Or just whenever he gets/loses cash? But anyway, as Solid said, just check it from time to time and compare. Yeah, its doing exactly that onClientRender. SCIENCE!
-
Hey Peeps, I remember some arena interior with a big screen inside. On this screen you can see parts of the track while driving. It actually shows the players. I haven't notice any lags while being there so it doesn't just seem to a trick as in various rear view mirror scripts. Doesn't this mean there is something included in GTA that would make a second camera possible? Bonsai
-
Buy next map is basically the same as /nextmap command of race resource. Just check how its done there. As far as I know it just checks if some variable is set, else vote starts.
-
Well, I don't know about the rest of your script. But I guess you can easily get the radar position of your player blip, the radar position of that other blip, do some math and use your players world position to get the blips world position.
-
So its not about making blips be shown at right position? You just want to get their position? At some point you set their position, so you could just save it there.
-
Maybe this helps you, might be a bit tricky since its not the whole code of my radar, but maybe this gives you a basic idea of how you could do it. local function getCameraRotation () px, py, pz, lx, ly, lz = getCameraMatrix() local rotz = 6.2831853071796 - math.atan2 ( ( lx - px ), ( ly - py ) ) % 6.2831853071796 local rotx = math.atan2 ( lz - pz, getDistanceBetweenPoints2D ( lx, ly, px, py ) ) --Convert to degrees rotx = math.deg(rotx) rotz = math.deg(rotz) return rotz end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end if getPedOccupiedVehicle(localPlayer) ~= false then theVehicle = getPedOccupiedVehicle(localPlayer) elseif getCameraTarget(localPlayer) ~= false then theVehicle = getCameraTarget(localPlayer) else return end local rotation = getCameraRotation() for i, p in pairs(getClientPlayersInArena(arenaElement)) do if getElementData(p, "state") == "Alive" then if getPedOccupiedVehicle(p) and getPedOccupiedVehicle(p) ~= theVehicle then local x, y, z = getElementPosition(getPedOccupiedVehicle(p)) local name = getPlayerName(p) local c1, c2 = string.find(name, '#%x%x%x%x%x%x') if c1 then blipr, blipg, blipb = getColorFromString(string.sub(name, c1, c2)) else blipr = 255 blipg = 255 blipb = 255 end local distance = getDistanceBetweenPoints2D(x, y, lx,ly) local rotation2 = findRotation(x,y,lx,ly) local , yd = getPointFromDistanceRotation(startwidth+(width/2), startheight+(height/2), distance/3.3, rotation2-rotation) if < startwidth+edgeVertical then = startwidth+edgeVertical elseif > startwidth+width-edgeVertical then = startwidth+width-edgeVertical end if yd < startheight+edgeVertical then yd = startheight+edgeVertical elseif yd > startheight+height then yd = startheight+height end dxDrawRectangle ( -4, yd-4, 8, 8, tocolor ( 0, 0, 0, 255 ) ) dxDrawRectangle (-3, yd-3, 6, 6, tocolor (blipr, blipg, blipb, 255 ) ) end end end
-
Nobody forces you to put your "full" code here, but if you did, its because you want people to help you. After your problem was solved you can't just remove it. If you want private help, go ask someone in pm. And by the way, this custom radar/blips stuff is hardly worth stealing.
-
No Idea why that weird guy removed all the code that might help others.. But still, there a plenty of other topics. And you could also try to do it on your own, its not that hard, just some testing needed.
-
I remember there was a very similar topic before, since I replied there. Go search for it. It contains everything you need to get this done.
-
Its so sad people are using others codes, public or not, without understand a single line of it. And most of the time people on this forum even just throw a working solution around.
-
Hey Peeps, just a little question. I know there can be a huge delay until an event is actually triggered if its between client <--> server. But I'm wondering if the order will stay the same no matter how long it takes until the events are triggered. Example: function() triggerServerEvent A triggerServerEvent B end Is there any situation where B is triggered BEFORE A? If so, I would have to make sure A is definitely triggered first.. Thanks for helping. Bonsai
-
Like Map Editor Browser? But its not 360°, you just rotate the objects.
-
You can also provide a position on table.insert.
-
You can always make things more complicated than they have to be
-
As far as I know you have to nil things to make Lua clear it.
-
Hey, I suggest a function to set this floating death camera that shows up after you died enabled or disabled. If thats possible, this would make a lot of things easier. Bonsai
-
Try using setWorldSoundEnabled. Development Mode + showsound.
-
No idea about the auto extract thing. You are talking about a radar looking like GTA 5?
-
Well, race pickups are just some normal objects with a custom model and a colshape to detect the hit. You can easily create them yourself and use the colshapehit event to do the pickup handling.
-
No. Learn more about events here: https://wiki.multitheftauto.com/wiki/Event Oh, didn't know that. I'm used to work with source only. Thanks.
-
If you continue spamming you will get banned.
-
You expect us to just post a solution while you don't even describe the problem? Replace client with source.
-
Yeah, its clientside already. But using onClientRender... thats seems to be a dirty solution