Jump to content

Ben_Sherman

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Ben_Sherman

  1. Hello, I have big issues with desync for trailers and tow trucks, if wonder is there anyways to solve this script wise if so how would I do to sync the trailers/towtrucks. Any ideas?
  2. Not sure whats going on if this is a bug on mta 1.5 or not however since mta 1.5 came out I'm no longer able to use /showcol, it states that showcol has been set to 1 and 0 even tried SetDeveloperMode(true) but doesn't change anything. The rendering no longer works on 1.5 however if I jump back on to 1.4 it renders correct, don't know what the problem is or anything that I can do to solve it but damn it sucks when your trying to verify that a colshape has been correctly placed. Nor can I actually make a bug report about it on the bug tracker as apparently my account is only a viewer and can not be reporting issues. -Sincerely
  3. Thank you all for all the help I could get, after more debugging I returned results however it had to be in the exact coordinates the colshape where created in or it wouldn't work. I then switched to createColPolygon and from there it worked perfect. So I have no clue what the real problem was however it got solved with createColPolygon
  4. I have no idea why that might be other than that you may have missed out a minus or something in the position. Try teleporting to the exact position of the colshape (i.e. [OOP] Player("your nickname").position = tempCol[1].position, preferably on a command handler) I've verified the position of the colshape however still not working, I've even tried getElementsWithinColShape for players within that colshape and it still returns 0
  5. Hello, I'm trying to create colshape that detects cars within it, however since /showcol and SetDevelopeMode(true) doesn't do anything for me I can only guess the colshape is correct placed as I took it from getElementPosition of myself. However everytime I run the colshape function it returns back 0 objects within which makes the function return back as nil. Can't figure it out what the problem is, I've tried vehicles I've tried players. I'ver tried it all and I some how can't get a return back value. local tempCol = { [1] = createColCuboid ( 1367.1826171875, -1659.076171875, 13.3828125, 23, 12.5, 10), } function getVehicleWithinColShap() local cars = getElementsWithinColShape(tempCol[1], "vehicle") outputDebugString(tostring(#cars)) for i, veh in pairs(cars) do return veh end end function testCommand(player, cmd) local found = getVehicleWithinColShap() if not found then outputChatBox(" ERROR ", player, 255, 255, 255, false ) end end addCommandHandler("test", testCommand)
  6. Thank you Jusonex, I checked your CEF tool out before as those worked however couldn't get it to work with my current resources.
  7. Hello everyone, First of I'd like to say what an amazing release of 1.5 it was, blew my mind away. However I thought why not jump right in to it so I started working with CEF after finally kinda understanding it and got it to load a HTML file I started having issues. For example I'm not able interact with the HTML what so ever, not a single button or input can I use. It's just static noting else. Anyone have any ideas on how I can resolve this? c_webUI.lua function openWebUI() if not(isElement(webBrowser)) then fadeCamera(false) webBrowser = createBrowser(sWidth, sHeight, true, false) addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "html/index.html") addEventHandler("onClientRender", root, webBrowserRender) end ) end end function webBrowserRender() dxDrawImage(0, 0, sWidth, sHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end
  8. I was just thinking about doing that, thanks for the suggestion as well, I'll work with it and see what I can find. I'll be in touch as soon as I know more
  9. Sadly no, it happens with everything, it doesn't matter if I create a new script to attach the element with, it will still stop destroy the element once I exit the vehicle, so far I've check most of my scripts for old code that could cause the issue or delete the element itself however I haven't managed to find anything related to it.
  10. Hello MTA, So a while back ago I stopped playing and turned off my server however after a few friends approached me to start up a server again together with them I've got back, however since then I've noticed some problem that I haven't managed to fix myself for some weird reason I can't seem to figure out what the issues is. So here is the issue, if I attach an element to a vehicle such as the public glue system if some one then exits the vehicle that element gets removed for some weird reason and won't be back on the server again until I restarts it. I've debugged all of this event several times and there are nothing outputed to the debug window that concerns me, not a warning, not a error it just completely disappears. Anyone have any glue what it is or how I can solve it I would be really great ful. -Sincerely Ben
  11. OMG great tool, wasn't even aware of this tool. However I think I found the problem as I made a timer on the server side however it was adding new times each time a player connected which took alot of CPU of the server I think. I removed that time and now it works perfect. No clue why I didn't add it on clientside. Misstakes are good as you learn from them. Thanks alot for the help!
  12. Ben_Sherman

    Response Issue

    Hello Everyone, I have some terrible response issues on my server and I wonder how I can fix it. When I mean response issues I mean that when I execute a command it goes fast as hell but more and more often randomly slow as hell. This goes for everyone such as a chat message I send in game or pressing a bind. Every time this happens is 100% random. Yea could be connection issues however I have 41 in ping on the server, pretty much everyone on the server has around 40-60 in ping. I my self have 100/100mb/s in internet. My server has 1gbs per port so that shouldn't be a problem as well. Can't really figure out what it is as my server status are pretty much fine and there are no problem with it besides this one that I'm talking about right now. It happens like a week ago or so. Any clue how to fix or find the problem here? Status right now of my server when it just happened: Bandwidth Usage 20.75 GB of 4.77 TB Used / 4.77 TB Free Memory Usage 342.05 MB of 4 GB Used / 3.67 GB Free VSwap Usage 0 KB of 0 KB Used / 0 KB Free Disk Usage 4.78 GB of 100 GB Used / 95.22 GB Free
  13. Hello, I just had an amazing idea however it kinda reminds me of some function I so around SAMP, however f**k samp am I right? Well how about I stay on the subject. I want to create a live editor and I need some help in order for me to do that. I'm not really sure what functions you guys recommend me and such in order to pull it off. This is just a brief example of how it should kinda look like, basically it should have this lines and button which you can click on and by moving the mouse while holding down the button on the UI it should move the object, and then it comes additional buttons in the bottom section of the UI which will switch the buttons to rotation instead. So I'm not really sure how to do this and thought why not ask the community itself as it seems like you guys have alot of ideas how to create stuff and definitely know alot more functions among MTA. Some of you might say straight away "Look around the forums and wiki" well I did that however I didn't really find what I was looking for and I wouldn't write a topic unless I needed the help. Thanks for your replies! Sincerely, Ben
  14. Alright thanks for the help, that means my method isn't in correct then and it should be working if the function wasn't bugged.
  15. Hello everyone, I'm trying to sync the setPedLookAt function however I've ran in to some issues since it clearly broadcasts the source and it's coordinates however it's still not change the the look of the other players as it the setPedLookAt function isn't applied to them. But for all of us it works client wise but not the globally. So maybe some one here knows either how to sync it maybe are able to help me out there as this is kinda frustrating. As I debugged the string in on client side it clearly gives me the players coordinates and including it's name so I know that it's transmitting everything correct. Even as the other players move their head around I can still see the coordinates changing as well. Client side: function UpdateFunction() local rotcam = math.rad (360 - getPedCameraRotation (localPlayer)) local xpos,ypos,zpos = getPedBonePosition ( localPlayer, 8 ) local xlook,ylook,zlook = xpos - 300*math.sin(rotcam), ypos + 300*math.cos(rotcam), zpos if xlook and getElementHealth(localPlayer) > 0 then triggerServerEvent("sendRotHead", localPlayer, xlook, ylook, zlook) end end addEventHandler("onClientResourceStart",root, function () setTimer(UpdateFunction,1000,0) end) addEvent("rotHead", true) addEventHandler("rotHead", root, function(xlook, ylook, zlook) if isElement(source) then outputDebugString(tostring(getPlayerName(source)).." X: "..xr.." Y: "..yr.." Z: "..zr) setPedLookAt (source, xlook, ylook, zlook, -1) end end) Server side: addEvent("sendRotHead",true) addEventHandler("sendRotHead",root, function (xlook, ylook, zlook) if isElement(source) then triggerClientEvent(root,"rotHead",source, xlook, ylook, zlook) end end)
  16. Hey everyone, I'm quite new to lua coding as most've known, however I'm learning much each day and each day. I want to make an awesome system for admins to kinda "live map" in game but I need to make it so it detects the ground and walls so people aren't placing objects through the ground or the wall, how ever I have no clue how to detect such things via a script. Any ideas or suggestions?
  17. OMG I love you man, it works perfect! THank you so much!
  18. Thank you xXMADEXx, Going to start in a few minutes and see if I can get something to work. Btw that was one hell of a great login screen. Looks amazing! EDIT: Well some how I cant define the value to the table so it can define it's dynamic position and so on for the mouse cursor and other propertis so right now it's not working. Think it's the tables thats wrong. Can't find the issue here. Tables: local data = { value[1] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } }, value[2] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } }, value[3] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } } } Dynamic Section: function RandomDynamicSystem() local now = getTickCount() local elapsedTime = now - start local endTime = start + 500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, dSizew, dSizeH, 255, progress, "InOutQuad") local r,g,b,a = 23,23,23,204 dxDrawRectangle(lx, ly, x1, dSizeH, tocolor(0,0,0,204), false) local butW, butH = 226, dSizeH / totalButtons - 2.5 local bx,by = ax+2, ay+2 local x2, y2, z2 = interpolateBetween ( 0, 0, 0, butW,butH, 255, progress, "InOutQuad") for i = 1,totalButtons do data.value[i].posX = bx data.value[i].posY = by data.value[i].posW = butW data.value[i].posH = butH local r, g, b, a = unpack ( data.value[i].colors ) dxDrawRectangle(data.value[i].posX,data.value[i].posY,data.value[i].posW,data.value[i].posH,tocolor(r, g, b, a),false) by = by + butH+2 end end
  19. Thanks, yea I hope so as well. Got a great plan already. I want my GUI's to be in Metro theme (Windows and I want them userfriendly
  20. Hey .:HyPeX:. Thanks alot for your reply, and trust me I know about people not really asking for the help just expect to get help without really asking polite. Anyhow your examples sounds and looks great however nothing happens for me. I think it's due to the fact that my GUI is changing it self pending on how many buttons it have access to. It's going to be a system that interact with players like adding buttons that says "Add to friendlist" and more, so if there is a button thats not available for just you it wont be there. Not quite sure if it has to do with that. Like the buttons itself is dynamic however I have no clue it that might case the issue or not. But I'd guess thats why it's not working... Best Regards, Ben EDIT: If i use onClientMouseEnter event on a label switching the color via that it works the problem is like I said it's dynamic so it colors all of the button and not just the one that I'm hover over. So I'll guess it works must be me that are doing it wrong I'll guess.
  21. Hello everyone, I've searched around the forums and internet for some kinda clue how to create a function to change the color for a dxDrawRectangle when you hover over it with your mouse. I've found some kinda clue with getCursorPosition() and I've found a few examples for it but none of them are working and quite frankly I'm problem why it's not working. Not use to work with dxDrawRectangle so I have no clue how to make a hover function for it. Maybe some one out here could give me an idea or show me and example of doing so? Would be really helpful. My source code, sorry about the mess, learning and testing new things function RandomTest() local now = getTickCount() local elapsedTime = now - start local endTime = start + 500 local duration = endTime - start local progress = elapsedTime / duration local x1, y1, z1 = interpolateBetween ( 0, 0, 0, dSizew, dSizeH, 255, progress, "InOutQuad") dxDrawRectangle(lx, ly, x1, dSizeH, tocolor(0,0,0,204), false) local butW, butH = 226, dSizeH / totalButtons - 2.5 local bx,by = ax+2, ay+2 local x2, y2, z2 = interpolateBetween ( 0, 0, 0, butW,butH, 255, progress, "InOutQuad") for i = 1,totalButtons do dxDrawRectangle(bx,by,x2,butH,tocolor(23,23,23,204),false) -- Trying to make a hover function for this one. by = by + butH+2 end end Sincerely, Ben
  22. Thanks man, works like a charm. Now I've learned something new today. Big thanks from sweden!
  23. Hello everyone, I'm making a K9 script and so far everything is working well besides that I can't seem to get the barking part working for everyone thats near the K9, it's only playing the sound for the player that executes the command. Any idea whats wrong here? function Bark() local x, y, z = getElementPosition(getLocalPlayer()) local int = getElementInterior(getLocalPlayer()) local dim = getElementDimension(getLocalPlayer()) local px, py, pz = getElementPosition(getLocalPlayer()) if (getDistanceBetweenPoints3D(x, y, z, px, py, pz)<50) then local sound = playSound3D("Barking.wav", x, y, z) setSoundMaxDistance(sound, 40) setElementDimension(sound, dim) setElementInterior(sound, int) attachElements ( sound, getLocalPlayer() ) if (isPedInVehicle(getLocalPlayer())) then setSoundVolume(sound, 0.5) else setSoundVolume(sound, 1.0) end end end addCommandHandler("bark", Bark)
  24. Thanks guys so much, couldn't get better answers among this question!
  25. Hi there, So I'm not very good with GUI's besides making them, some how everytime I make one and try to place it good on all resolutions for the game it never turns out so great. I've tried and tried, I've look on google and here for help about it but never managed to find anything useful. I don't really know how to make the GUI's location the exact same as for all resolutions and not just my resolution, I've tried 2 type one made it line up in center quite good, but some how the rest besides the background ended up on the left side of the gui, all text and other dxDraws. Normaly their lined up a little to the right but not so far off as it was when I made it like that. I manager to make it fit quite good on 2 differents resolutions 1600x900 and 1920x1080 the only problem was that the location of the GUI on 1600x900 was located a bit to the right and not really lined up properly, but almost. So I thought I should ask here for some help or maybe some tips on how to line it up on the exact same location on all resolutions. -Regards, Ben. function showGUI() local x, y = guiGetScreenSize() dxDrawRectangle((628.0 / x)*x,(309.0 / y)*y,664.0,498.0,tocolor(0,0,0,210),false) dxDrawRectangle((779.0 / x)*x,(374.0 / y)*y,496.0,414.0,tocolor(90,134,255,180),false) dxDrawRectangle((779.0 / x)*x,(348.0 / y)*y,86.0,26.0,tocolor(90,134,255,180),false) dxDrawRectangle((628.0 / x)*x,(258.0 / y)*y,664.0,51.0,tocolor(90,134,255,210),false) dxDrawImage((871.0 / x)*x,(272.0 / y)*y,178.0,27.0,"report.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) end
×
×
  • Create New...