Jump to content

Ben_Sherman

Members
  • Posts

    57
  • Joined

  • Last visited

About Ben_Sherman

  • Birthday 29/09/1991

Details

  • Location
    Sweden
  • Interests
    Gaming

Recent Profile Visitors

1,054 profile views

Ben_Sherman's Achievements

Snitch

Snitch (10/54)

8

Reputation

  1. Hello, I'm simply just wondering where the heck the checkbox to allow custom gta3.img has gone from the settings page, would greatly appreciate it as I'd like to be able to use custom trees but it seems like it's only textures that are working...
  2. Hello everyone, not to long ago I started working on one of my scripts, it's ages ago I started on it as U can see in the video, however, I decided to continue working on the script. I've always wanted to run a Festival event in-game before but never really pulled it off, lack of interest, lack of people and so on. I started a couple of years ago to animate one song manually, but if everyone wasn't synced with the track it got desynced for some clients. I thought of different ways to do it but ended up dropping it till not too long ago when I thought about it again. I started integrating wave-data to fetch the bass, pitch etc. This is what I came up with, let me know what u think, rate it, give me your feedback. All though note this video was taken early in the development of the sound data being fetched. Music's from a live stream as well, meaning no clients will ever be desynced. P.S, since I closed down my server, I'm considering to finish this script and release it to the public based on feedback.
  3. Ben_Sherman

    im new

    Is the bounty automatically done or done via a command? From the looks of things you've only made it so that when ever you write the command it outputs the text, however, there is no extra data behind it in which you'd determine if the player has a bounty or not
  4. Ben_Sherman

    Dx-Timer

    Haven't tested it to see if it works, but the general concept should give you some clues on how it's supposed to be done, hope you understand the overall concept. The rest is up to you, enjoy! -- Server Side addEvent("onBotWasted",true) addEventHandler("onBotWasted",getRootElement(), function (killer) if (source == nemesilv) then destroyElement(BlipNemesislv) -- You pick one that suits you the best triggerClientEvent(killer, "createBag", killer) -- Trigger is sent to ONLY the killer triggerClientEvent(getRootElement(), "createBag", killer) -- Trigger is sent to ALL players end end) -- Client Side function createBag() local minute, seconds = 20, 60 setTimer ( function() -- Your code, remember instead of making it count one time after 20 minutes this section here is executed every second for 20 minutes -- One example would be using the GUI that you entered as example if seconds > 0 then seconds = seconds - 1 else seconds = 60 minute = minute - 1 end if minute == 0 and seconds == 0 then -- What to trigger when timer hits 0 end --Updates the GUI text guiSetText(guiElement, ("%02d"):format(tonumber(minute))..":"..("%02d"):format(tonumber(seconds))) end, 1000, 60*20 ) end addEvent("createBag", true) addEventHandler("createBag", resourceRoot, createBag)
  5. Ben_Sherman

    Dx-Timer

    If you're trying to run the timer for a client-side function, you can't add it server-side. The timer itself can't be cross executed like that, however, what you can do triggering it via a trigger bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [ bool getPropagated = true, string priority = "normal" ] ) bool triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] ) If you need a full example, you need to tell me more info about the script, how it should work, what it should do and so on.
  6. Not sure where you're saving it, but here is how you get the data from a player as well an example of storing it, however, the storing function is client-side ONLY. If you want to save the data from a server-side script you need to replace getLocalPlayer() with the player itself. getElementData(getLocalPlayer(), "radio.title") setElementData(getLocalPlayer(), "radio.title", theData)
  7. Please refer to what the wiki states, more info https://wiki.multitheftauto.com/wiki/EngineReplaceCOL
  8. I assume you get the error message on line 3 since you never said where, if so to avoid the error message just change line 2 to this local radio_title = getElementData(resourceRoot, "radio.title") or "" the reason you get that error message is because whenever "radio.title" doesn't exist it returns it as false, and you're trying to get the length of a string in which it gives you that error message. I hope it helps, I can't confirm this solves the problem, as I've run into very weird problems with Lua lately, however, it should work script-wise.
  9. Can some one please explain to me what's wrong with this, I've tried triggering it with both getRootElement() as well as without it, the trigger needs to be sent to everyone. Currently, it only sends the trigger to the player in the seat, it's not sending it globally to every player, however, the trigger at the very top is being sent to everyone... I've tried everything so far, and it's not being triggered globally for every player, only the guy in the seat itself. I know I can make it as easy as lowering all windows once it's being triggered but I only want the window for the occupied seat to be lowered. Anyone have any clue? I'm completely lost and I have no clue how to solve it, I took a break from MTA for 6 months, I came back and if I had 50 bugs before on my server, it now has 500 bugs it's like LUA or what ever got a big stroke, nothing works anymore. I went over everything, double checked wiki and everything seems to be fine but yet it's not being triggered globally. Line: 19 is the issue, line 12 is working perfectly function toggleWindow(thePlayer) if not thePlayer then thePlayer = source end local theVehicle = getPedOccupiedVehicle(thePlayer) if theVehicle then if hasVehicleWindows(theVehicle) then if (getVehicleOccupant(theVehicle) == thePlayer) or (getVehicleOccupant(theVehicle, 1) == thePlayer) then if not (isVehicleWindowUp(theVehicle)) then for i = 0, getVehicleMaxPassengers(theVehicle) do triggerClientEvent(getRootElement(), "vehicle:syncWindows", thePlayer, theVehicle, i, false) setElementData(theVehicle, "vehicle:window_"..tostring(i), false, true) end else for i = 0, getVehicleMaxPassengers(theVehicle) do local player = getVehicleOccupant(theVehicle, i) if (player) then triggerClientEvent(getRootElement(), "vehicle:syncWindows", player, theVehicle, i, true) setElementData(theVehicle, "vehicle:window_"..tostring(i), true, true) end end end end end end end addEvent("vehicle:togWindow", true) addEventHandler("vehicle:togWindow", root, toggleWindow) addCommandHandler("togwindow", toggleWindow) Clientside Function local seatWindows = {[0] = 4, [1] = 2, [2] = 5, [3] = 3} function syncWindows(theVehicle, seat, state) outputDebugString("SEAT "..tostring(seat)) setVehicleWindowOpen( theVehicle, seatWindows[seat], state ) end addEvent("vehicle:syncWindows", true) addEventHandler("vehicle:syncWindows", localPlayer, syncWindows)
  10. Would be great if you gave us more details, like what is a country chat script....
  11. I have CEF stuff already, and just loading html files crashes 50% of the population on my server for some reason. Anyhow all of these are great recommendations, however, aren't really answering my question. Like I've made so many custom UI's with woth dx and regular GUI, the problem is it's clunky and very annoying to do. I'm talking about actual UI themes. I was googling a bit last night and apparently owl gaming just released a patched the other day with custom UI framework. I'm talking about custom GUIs like this or this video first 10 seconds as an example Now I'm not saying I wanna copy owl or anything like that, I mainly wanna know how so that I can make my own unique UI
  12. Hi there, I've got a very good question here that I've been googling for some time now. Is it possible and if so how would you go with doing your own custom UI / GUI theme server sides, meaning not installing one on your computer. I know there is a resource called SDT_GUI by Skyline.(laserlaser), is there any other way to do it or am I just wrong?
  13. Oh you mean like that, tested a theory of that before however that still hits the performance which is basically just the loop itself that does it. The only way to reduce it is either removing the icons blips itself so there is like 10 of them for example or find a way to add the the nearest icons to the table.
  14. A little update, I've tested restricting it to one resource right now just as a test and that didn't drop the FPS to much however the problem is that I got tons of resources with creating blips dynamically based on what it is. Tried the streamed in function doesn't really do anything as all blips are still appearing even if I've set the blip distance to 60 when it was created. I'm clue less how to do it.
  15. What's up everyone, so I've recently discovered that one of my scripts is causing massive lag for people. As it never caused it for me I never discovered it till now 2 months later. The problem here is that the radar created is causing lag as it's being rendered and on top that it has a loop fetching the server icons/blips which are causing the problems. Since I'm out of ideas how to resolve this maybe someone here knows what to do. The main issue is that this loop is being called once per frame, 60 frames * 60 icons/blips = 3600 times per second, you might see the problem I'm having now, I've tried limiting it to nearest blips/icons however since I don't know how to do this from the loop itself without looping through all of them it doesn't really have an impact. The only solution I've actually found to this is disabling the loop itself but then I got no blips/icons which I kinda need. I've wrapped my head around this all night and can't seem to figure a solution out without loosing FPS or losing the blips, maybe one here is smarter then me. for _, blip in ipairs(getElementsByType('blip')) do -- PROBLEM IS THIS local blipX, blipY, blipZ = getElementPosition(blip) if (localPlayer ~= getElementAttachedTo(blip) and getElementInterior(localPlayer) == getElementInterior(blip) and getElementDimension(localPlayer) == getElementDimension(blip)) then local blipDistance = getDistanceBetweenPoints2D(blipX, blipY, playerX, playerY) local blipRotation = math.deg(-getVectorRotation(playerX, playerY, blipX, blipY) - (-pRotation)) - 180 local blipRadius = math.min((blipDistance / (streamDistance * Minimap.CurrentZoom)) * Minimap.NormalTargetSize, Minimap.NormalTargetSize) local distanceX, distanceY = getPointFromDistanceRotation(0, 0, blipRadius, blipRotation) local blipSettings = { ['color'] = {255, 255, 255, 255}, ['size'] = getElementData(blip, 'blipSize') or 20, ['exclusive'] = getElementData(blip, 'exclusiveBlip') or false, ['icon'] = getBlipIcon ( blip ) or 'target' } local blipX, blipY = Minimap.NormalTargetSize * 1.5 + (distanceX - (blipSettings['size'] / 2)), Minimap.NormalTargetSize * 1.5 + (distanceY - (blipSettings['size'] / 2)) local calculatedX, calculatedY = ((Minimap.PosX + (Minimap.Width / 2)) - (blipSettings['size'] / 2)) + (blipX - (Minimap.NormalTargetSize * 1.5) + (blipSettings['size'] / 2)), (((Minimap.PosY + (Minimap.Height / 2)) - (blipSettings['size'] / 2)) + (blipY - (Minimap.NormalTargetSize * 1.5) + (blipSettings['size'] / 2))) if (blipSettings['icon'] == 'target' or blipSettings['icon'] == 'waypoint' or blipSettings['icon'] == 0 or blipSettings['icon'] == 1) then blipSettings['color'] = {getBlipColor(blip)} end if (blipSettings['exclusive'] == true) then blipX = math.max(blipX + (Minimap.PosX - calculatedX), math.min(blipX + (Minimap.PosX + Minimap.Width - blipSettings['size'] - calculatedX), blipX)) blipY = math.max(blipY + (Minimap.PosY - calculatedY), math.min(blipY + (Minimap.PosY + Minimap.Height - blipSettings['size'] - 25 - calculatedY), blipY)) end dxSetBlendMode('modulate_add') dxDrawImage(blipX, blipY, blipSettings['size'], blipSettings['size'], 'files/images/blips/' .. blipSettings['icon'] .. '.png', 0, 0, 0, tocolor(blipSettings['color'][1], blipSettings['color'][2], blipSettings['color'][3], blipSettings['color'][4]), false) dxSetBlendMode('blend') end end
×
×
  • Create New...