Jump to content


  • Posts

  • Joined

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Lergen's Achievements


Snitch (10/54)



  1. Awesome news, was wondering about whether or not you guys would decide to OS it. Thanks for you and everyone else's work on this so far, it's really shaped up over the past few years and is exciting to see the development move along.
  2. Great to see progress on this. Any rough estimate on when we might see a playable release, or are you guys waiting to reach a certain "goal point" before doing so?
  3. This is a long dead thread but nobody ever actually explained how to accomplish turret rotation. It doesn't get mentioned a lot but setVehicleComponentRotation is a very useful function that allows you to rotate any component on a vehicle model. There's probably more roundabout ways to go about it but that should be a decent starting point for attempting that sort of thing.
  4. This is a rather niche question but if anybody can give me even a vague pointer in the right direction, that'd be great as I'm a bit unfamiliar with how to tackle these sorts of problems. I have a horizontal, spiral shaped vehicle component that I want to "spin" like a rotating drill without moving the drill itself from the position it is facing. Like this: The problem is that using setVehicleComponentRotation on a basic clientrender event moves the ENTIRE drill either left, right or up and down and I'm not sure of how else to emulate this "drilling" effect. I'm sure it should technically be possible but I've no idea how to go about it. I realize it might be a bit of a difficult question, but any advice would be greatly appreciated.
  5. After further testing, it seems any objects created serverside with createObject, then moved with the moveObject function into it don't trigger the colshape hit event either. Vehicles and players seem to be the only thing that actually trigger the event. I'd assume objects and peds created on the server should also be "seen" by a serverside colshape. Not sure what I'm missing here.
  6. I might be mistaken, but all that looks like is GetElementHealth coupled with math.percent to get the percentage of health from the player's current total. If you want it for the local player like in that screenshot, you can just display the value it returns via a dxDraw function from the client-side. EDIT: Just realized you might actually be talking about that damage points thing at the bottom left. It's a bit simplistic but you could probably calculate that by using a combination of OnPlayerDamage to see if the shot lands, then GetPedWeapon to adjust how many points to add depending on the weapon they're using. Or just use the loss argument from OnPlayerDamage to get how much damage they did.
  7. Is it possible to have serverside peds trigger a colshape? I would assume that this should be possible, but I simply cannot seem to get them to trigger it. Empty vehicles, the player and etc elements seem to work, just not the peds. testPed = createPed ( id, x, y, z, r ) setPedAnimation(testPed, "ped", "WOMAN_run") testZone = createColRectangle ( x, y, fwidth, fheight ) function testFunc ( targetElem ) setElementAlpha ( targetElem, 0 ) end addEventHandler ( "onColShapeHit", testZone, testFunc ) In this example I create a ped, and have it run toward the direction of the colshape. However it does not trigger the function attached to the colshape. I used changing the alpha for this example but chatbox outputs, etc all similarly fail to trigger from serverside peds. Anything else that enters it will trigger it as it should, just not the peds for whatever reason. Am I forgetting something here? Any advice would be appreciated.
  8. Always good to see stuff like this, script optimization is something that's often overlooked despite how important it can be. Props to your good work and for keeping it open-source.
  9. As was mentioned, the vehicles are spawned from broph.lua. Specifically from the table "vehiclestoSpawn". I can't check right now but going purely off memory I -think- the coordinates for the Grove Street vehicles were these lines. {469, 2526.2607421875, -1677.2861328125, 19.913991928101, 91.994018554688}, {468, 2500.9921875, -1681.0166015625, 13.033525466919, 46.989013671875}, {468, 2502.7431640625, -1678.8779296875, 13.043078422546, 48.0439453125}, {468, 2504.5947265625, -1676.859375, 13.042449951172, 48.0439453125}, {492, 2505.59375, -1661.69921875, 13.18674659729, 35.120880126953}, If you don't want to bother with specifics you can just delete the table entirely which will remove all "default" vehicles placed on the map. That way you can just use your own vehicle placements and not have to worry about peds getting stuck on the default ones.
  10. The text is drawn by finding where the ped is on your screen: local pedX,pedY,pedZ = getElementPosition(NPC) local sx,sy = getScreenFromWorldPosition (pedX,pedY,pedZ) local cameraX,cameraY,cameraZ = getCameraMatrix() Then drawing the text on that spot: if sx then if getDistanceBetweenPoints3D(cameraX,cameraY,cameraZ,pedX,pedY,pedZ) <= texto_alcanze then dxDrawText(texto,sx,sy,screenWidth, screenHeight,tocolor ( R, G, B, Text_Opacidad ), size,fuente) So if you want to modify the position of the text, you can just add or subtract from those positions. For example: dxDrawText(texto,sx - 80,sy - 80,screenWidth, screenHeight,tocolor ( R, G, B, Text_Opacidad ), size,fuente) PS there's an option to add code when you're making a post instead of just pasting the raw-text (it's easier to make sense of).
  11. If I'm understanding right, you want to have it only trigger the chatbox if it's not a player driving it? It's a bit ad-hoc but you could try this: local marker = createMarker(2548.81494, 2573.95142, 14.99850-5, "cylinder", 15, 255, 0, 0, 50) function isVehicleEmpty( vehicle ) if not isElement( vehicle ) or getElementType( vehicle ) ~= "vehicle" then return true end if getVehicleOccupant( vehicle, 0 ) then return false end return true end function enter ( targetElem, matchingDimension ) if isVehicleEmpty(targetElem) == true and getElementModel(targetElem) == 537 then outputChatBox ( "Train Stopped", root, 255, 255, 109 ) end end addEventHandler ( "onMarkerHit", marker, enter ) There's probably a better way of going about this, but this should only trigger the chatbox if the train has no driver.
  12. Can you give this a try? I gave it a test on my local server and it worked: local marker = createMarker(2548.81494, 2573.95142, 14.99850-5, "cylinder", 15, 255, 0, 0, 50) function enter ( targetElem, matchingDimension ) if getElementModel(targetElem) == 537 then outputChatBox ( "Train Stopped", root, 255, 255, 109 ) end end addEventHandler ( "onMarkerHit", marker, enter )
  13. You can give this a try (I think you just forgot the "if" statement): local stop = createColRectangle ( 2541, 2557, 10, 25 ) function enter ( targetElem, matchingDimension ) if getElementModel(targetElem) == 537 then outputChatBox ( "Train Stopped", getRootElement(), 255, 255, 109 ) end end addEventHandler ( "onColShapeHit", stop, enter )
  14. What I would do is use OnColShapeHit and use GetElementModel to check the ID of the vehicle that hits the sphere. If the ID is the same as your train's have it output to the chatbox. (you can check vehicle ID's from here if you need.)
  • Create New...