Jump to content

Xwaw

Members
  • Posts

    16
  • Joined

  • Last visited

Recent Profile Visitors

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

Xwaw's Achievements

Square

Square (6/54)

1

Reputation

  1. The problem is that there is a ped that runs straight, and there are also drawn lines that show how the ped is looking. And I would like to make this ped when it notices an obstacle with a given line "processOfLineSight" to paint it red from the green line. But unfortunately when the ped runs and sees an obstacle on the right side, the middle line lights up instead of the one on the right side. It's the same with the rest, the middle line, when it notices something, the left line lights up and so on. Can someone help me with this? local direction = 0 local testPed = createPed(0,2480.52344, -1649.07202, 103.77657, direction) local lineLength = -10 local distanceOfStart = 0 local color = {{255, 0, 0},{0, 255, 0}} local colorSet = 2 function drawLineFromHead(ped, angle) if isElement(ped) and getElementType(ped) == "ped" then local pedX, pedY, pedZ = getElementPosition(ped) local pedRotation = getPedRotation(ped) + angle local pedRotationRad = math.rad(pedRotation) local lineEndX = pedX + lineLength * math.sin(pedRotationRad) local lineEndY = pedY - lineLength * math.cos(pedRotationRad) dxDrawLine3D(pedX, pedY, pedZ + distanceOfStart, lineEndX, lineEndY, pedZ+ distanceOfStart, tocolor(color[colorSet][1], color[colorSet][2], color[colorSet][3]), 2) local hit = processLineOfSight(pedX, pedY, pedZ + distanceOfStart, lineEndX, lineEndY, pedZ+ distanceOfStart, true, false, false) if hit then colorSet = 1 else colorSet = 2 end end end function drawLinesForPerspective(ped) drawLineFromHead(ped, -45) drawLineFromHead(ped, 0) drawLineFromHead(ped, 45) end setPedControlState(testPed, "forwards", true) -- Main Loop addEventHandler("onClientRender", root, function() drawLinesForPerspective(testPed) local x, y, z = getElementPosition(getLocalPlayer()) end)
  2. Xwaw

    Ped scripting

    Ok so recently I was thinking of reworking the police from gta san andreas to mta san andreas and making a police waves style minigame you have to survive. I have an idea how to do it but I don't know if the engine will allow me to do it. So my question is, if I want to program a ped to get to the player's position avoiding obstacles (without jumping over them) with the a* algorithm, am I able to do that? Because the last time I did this type of thing, one such npc could crash my entire game. As for the respawn of such bots, it would work more or less in the same way as in the original version of gta sa
  3. Xwaw

    Table

    U tried Items[1][7] for example where [1] is index of first table and [7] is index for second table?
  4. Welcome back In general, I'm currently making a scoreboard under Tab with a list of players, so I have a few questions... 1. How to make a list that shows elements that are outside the image under the scroll, e.g. when scrolling html or guiCreateGridList function but with more elements than its scale offers (Using dxDraw family functions) 2. Or is there a possibility to blur something like placing a gradient so that some dxDraw elements line up in a shape other than a square or rectangle. If you still don't know what I mean, here's an example of what I want to do: I have a plan how the list of players (scoreboard TAB) will look like after pressing the [TAB] key and in general, if there are too many of these players, it is known that 1920x1080x monitor screen will not accommodate, for example, 400 players in the index so that it is visible, so you will need to add some scrolling system and here is my problem because I've never done anything like that and I don't know if it's possible to create a dxDraw function that simulates a guiGridList or add a gradient that will freeze most of the list so that it is visible for the computer screen, but not for us. Please give me an example with a detailed explanation
  5. Xwaw

    Nitro value

    Ok but what is max value of this nitro?
  6. Xwaw

    Nitro value

    Hello Is it possible to somehow check the value of how much NOS you have in the vehicle because I am looking for but not which do not seem to work as if they were not at all. I need this value to make a bar that will show how much nitro the vehicle has.
  7. Hi I wanted to learn how to create my own shaders for this game from lighting starting to moving texture on the wall. I would really like someone to give me a link to a page where I can find all the functions or if someone wants to explain to me what it is all about
  8. How to check the recoil of a weapon. Notice that when you shoot, for example, with an ak47, it starts with a slight recoil and after 3 seconds when you hold it, you have a large recoil and it stops at this recoil, then the bullets fly in all directions when you are, for example, on poor level. Therefore, is there something to check the recoil of a given weapon so that the int changes at the time of the initial recoil and the final recoil? Maybe the getWeaponProperty function but I don't see anything that could check it because "spread" for example stops on the same recoil.
  9. Re: And give an example of a script for which you will use e.g. "this"
  10. Hello, I recently returned to making a server after a year and I wanted to remind myself how the "source", "root", "this", "sourceResource", "sourceResourceRoot", "client" etc. Elements worked. Unfortunately, when I checked the MTA wiki, I didn't understand any of these elements. In general, the best help would be if someone explained to me how these elements work on examples for AddEventHandler because in mta wiki there is only one example for a "source" and I guess "root"? element
  11. Xwaw

    GuiEditor IMAGE

    I just want to know how you can import images into this "dxDrawImage" GUIEDITOR
  12. stPatrick, i want use command "createPed" and with it create ped who following my player
  13. Write me a script how to do it, I will be very grateful
  14. local g = 0 function giveGold() local g = g+1 end addCommandHandler("giveG", giveGold) function showGold(source) outputChatBox(tostring(g), 255, 255, 0) end addCommandHandler("showG", showGold) I mean, I want the "showG" command to show the Player amount of gold, and the "giveG" command wants it to add the Player amount of gold. It is on the client side. PLS HELP
×
×
  • Create New...