Jump to content

Trust aka Tiffergan

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Trust aka Tiffergan

  1. function createPanel(commandName) local window = guiCreateWindow(532, 373, 232, 171, "TELEPORTER POSITION", false) guiWindowSetSizable(window, false) local button_1 = guiCreateButton(141, 99, 64, 25, "EXIT", false, window) -- guiSetAlpha(button_1, 0.42) -- local button_2 = guiCreateButton(32, 99, 64, 25, "TELEPORT", false, window) local edit_box = guiCreateEdit(42, 37, 153, 21, "0,0,0", false, window) showCursor(true) addEventHandler("onClientGUIClick", button_1, function() if isElement(window) then destroyElement(window) showCursor(false) end end) addEventHandler("onClientGUIClick", button_2, function(player) local x, y ,z = string.match(guiGetText(edit_box), "(%d+), (%d+), (%d+)") x, y, z = tonumber(x), tonumber(y), tonumber(z) setElementPosition(player, x, y, z) end) end addCommandHandler("tp", createPanel) To use this script, the player can enter the desired coordinates in the format "x, y, z" in the edit box and click the "TELEPORT" button. This will teleport the player to the specified coordinates.
  2. @ToreTTo_MTAadd me on discord i send you a request
  3. To detect if a player is near a ped, you can use the isElementWithinColShape function. This function takes two arguments: the first is the element you want to check (in this case, the player), and the second is the colshape you want to check if the element is within (in this case, the ped). If the player is within the colshape of the ped, the function will return true, otherwise it will return false. Here is an example of how you might use this function in your script: function onClientRender() local player = getLocalPlayer() -- get the local player local ped = getPedOccupiedVehicle(player) -- get the ped the player is in if ped then -- if the player is in a ped local pedColShape = createColCircle(getElementPosition(ped), 5) -- create a colshape around the ped if isElementWithinColShape(player, pedColShape) then -- check if the player is within the colshape -- player is within 5 units of the ped, so do something here end end end
  4. To apply the S@moke box shader to a texture instead of the screen, you need to remove the followin fragments of code: sampler TextureSampler = sampler_state { Texture = <screenSource>; AddressU = Mirror; AddressV = Mirror; }; and float4 PixelShaderFunction(float2 texCoords : TEXCOORD0) : COLOR0 { // shader code } then you need to add following code sampler TextureSampler = sampler_state { Texture = <tex>; AddressU = Mirror; AddressV = Mirror; }; technique Draw { pass P0 { PixelShader = compile ps_3_0 PixelShaderFunction(texCoords); } } In the above code, `tex` is used as the name of the texture that the shader should be applied to, instead of `screenSource`. Also, a `technique` section was added, which allows the shader to be called from code. Including these changes should allow the shader to be applied to the texture instead of the screen. @raynner
  5. To transfer data from Lua to JavaScript and display it in HTML, you can do it as follows: In your Lua code, generate the data that you want to transfer to JavaScript. You can do this using the print statement or other methods of writing data to a file. In your JavaScript code, add code that retrieves the data from the file generated by Lua and saves it to a variable. You can do this using the fetch function or XMLHttpRequest. In your HTML code, add code that displays the data saved in the JavaScript variable. You can do this using the <script> tag or the document.write function. Here is an example code that illustrates the above process: -- Lua code player_name = "John Doe" player_score = 1000 -- save data to file file = io.open("player_data.txt", "w") file:write(player_name .. "\n") file:write(player_score .. "\n") file:close() -- JavaScript code // retrieve data from file fetch("player_data.txt") .then(response => response.text()) .then(data => { // split data by newline character var data_lines = data.split("\n") // save data to variables var player_name = data_lines[0] var player_score = data_lines[1] // display data in HTML document.write("Player name: " + player_name + "<br>") document.write("Player score: " + player_score + "<br>") }) .catch(error => console.error(error))
  6. Hello, I have a question, is there any way to improve the viewing distance? I mean, when aiming with a sniper rifle we have a higher level of vision than looking normally from a regular third person. So I'm curious if there is a possibility to block the render somewhere in the files at this maximum level. That we get when aiming with a sniper. Cheers. Hope I asks a question in the right section.
  7. It used to be but in 2014 or so if i remember correctly
  8. @oblivionosakai know that it existed before but i cant find it so i made one here : [snip]
  9. i got it http://www.mediafire.com/file/f4o4vw43llneylw/Mods_by_Venux.rar/file
  10. hello do you guys maybe have this theme
  11. Hello what function do i need to use to make show dmg to players i need smth like that
  12. Hi, I have a question, how can I block the option to set the debugging option on #grapics, I know that it can be blocked somehow because on the TOP-GTA server, when we set ourselves in options -> advanced and debug settings on #graphics, it pops up black screen saying to change to default, but I don't know what function checks whether the player has it set or not. Regards
  13. good idea with the ped that maybe will work, how i can get ped in vehicle using createped or what? @Tekken
  14. no errors no working :~... To be clear and everyone understands what I want to do, so I have a train that runs by itself on the tracks and keeps going all by itself, and I just want to do at each station in the LS / SF / LV Marker where the train would he stopped for X time, but the first thing I wants to do is that when he hits the marker, although I have a message about it in this case, "Train Stopped", although even it does not work, the earlier solutions would work if I was driving this train, but it drives by itself so here's the problem. I gave it a cuboid that is "stuck" to the train and I wanted to do something on the principle that if the cuboid would hit the marker, but such things can't be done either ... I don't know what to do...
  15. Change resolution for your sniper scope and that should work i did that on my server and it worked
  16. Just remember that I mean that there is an outputChatBox when the train enters the marker itself, and we do not steer it, because when I create a train from the admin panel and drive it, I also have it in my chat
  17. so there is no errors now when i add IF but this not working... this is video when my train ( cuboid ) hit rectangle there is no output on that https://streamable.com/hlmvld even try to do this on MARKER but not working too 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 )
  18. so i did something like that but im to stupid to make it working local stop = createColRectangle ( 2541, 2557, 10, 25 ) function enter ( targetElem, matchingDimension ) getElementModel(targetElem) == 537 then outputChatBox ( "Train Stopped", getRootElement(), 255, 255, 109 ) end end addEventHandler ( "onColShapeHit", stop, enter ) and error is in this line @Lergen getElementModel(targetElem) == 537 then unexpected symbol near '=='
  19. O i have attached cuboid, but how i can make information when train hit marker i will have output on chat?
  20. Hello can someone tell me how i can attached colsphere to moving vehicle, i trying to do moving train and when train hitmarker train will stop but i dont really know how i can attach sphere to train
×
×
  • Create New...