Jump to content

Wojak

Members
  • Posts

    321
  • Joined

  • Last visited

  • Days Won

    2

Wojak last won the day on August 26

Wojak had the most liked content!

1 Follower

Recent Profile Visitors

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

Wojak's Achievements

Prankster

Prankster (22/54)

8

Reputation

  1. Well... In theory it is possible to create a web interface that would control an avatar on the server and that avatar could interact with players in some simple ways (we already have the web chats on MTA community and they've been there since forever). As for seeing what is going on on the server the simplest way would be to display players and vehicles on GTA:SA map in the web browser (there was a time when MTA had this feature by default ), this days it is even possible to force any client on the server to take a screenshot and send that to a web client (though making a high quality stream in real time is rather impossible). That said - it would be nothing like playing MTA normally.
  2. Lines 21-23 in the code in the OP: if effectAtWheels[component] and isElement(effectAtWheels[component]) then return effectAtWheels[component] end this condition will always be met, therefor the function will be terminated in the first iteration of the for loop... What it the use of the 'waterSplash' table? If you don't use it anywhere else in the code, simply remove the 21-23 lines, if you need that table then I would suggest skipping the condition and returning the whole 'effectAtWheels' table outside the for loop.
  3. Witamy na Wojnie Ulicznej Wojowniku! Oto krótkie wprowadzenie do serwera Wciśnij przycisk „Dalej” Aby przejść do następnej strony Dalej Na serwerze są 3 drużyny: - Ballas (Don't traslate this line) - Police (Don't traslate this line) - Grove Street (Don't traslate this line) Po dokonaniu wyboru po prostu podbijaj terytoria dla twojej drużyny i walcz z przeciwnikami Specjalne wydarzenia i narkotyki Narkotyki dają ci zdolności takie jak: przyśpieszenie, więcej zdrowia... Aby otworzyć panel narkotyków wciśnij F4 Narkotyki można zdobyć poprzez udział w TDM który odbywa się co godzinę w szpitalu w LS ikona na radarze Czy jesteś gotowy Wojowniku? Jeśli dalej potrzebujesz pomocy wciśnij F1! Walcz! also change 'Drugs are get' to 'You can get Drugs'
  4. i forgot to replace shader wit shaders[ i ] on lines 81 and 82...
  5. First you need to save al the shaders, at line 77: local shaders = {} at line 80 change to: shaders[i] = dxCreateShader("texture.fx") and add the toggle function: local toggle = true function toggleradar() toggle = not toggle if toggle then for i = 2, #blips_textures do engineApplyShaderToWorldTexture(shaders[i], blips_textures[i][1]) dxSetShaderValue(shaders[i], "gTexture", dxCreateTexture(blips_textures[i][2])) end else for i = 2, #blips_textures do engineRemoveShaderFromWorldTexture ( shaders[i], blips_textures[i][1] ) end end end not tested but should be ok. I don't think that this is ever a good idea...
  6. First thing that you need to accept is that programing/scripting isn't something that can be learned in one day, even though I have several years of experience in lua I learn new stuff witch each new script I create. The requirements to get starting with programing scripting are: -patience and strong will, -understanding of English language, -basic math knowledge like operations on formulas (creating own formulas, merging formulas) and logical operations . If you have all that, then all you need to know is that programing/scripting is nothing more then talking to the computer (writing commands that the computer is able to understand and execute). To do that you need to learn a programing/scripting language like lua. Like any other language it has its rues syntax and grammar (a set of keywords and the way you use them). Unlike humans computers are very stupid, you need to tell them how to do every, even most basic operation from start to finish, without making any syntax or grammar error (luckily for us the most basic stuff are already covered by build in lua and MTA functions, so it's not that hard). So the most basic stuff you need to know about any language including lua are: variables – they are containers that hold various data like numbers or text ('strings'), depending on the data stored in them you can preform any sort of operations on them – mathematical, logical, ect. If .. else .. end statement – the way to control witch part of the code will be executed depending on the conditions functions – you may think of them like smaller scripts within a script tables – you may think of them like more powerful variables, tables are VERY important I would recommend to find a good lua tutorial and start with this topics, then jump to MTA event handlers so that you will be able to test your knowledge in game.
  7. Wojak

    Race Problem

    This problem usually happens on old MTA maps that have been converted to the current format. Some converts just skip the 'rotation' property of spawnpoints that had the rotation of 0... IMO the best way to fix this i to find the line in race_server.lua vehicle = createVehicle(spawnpoint.vehicle, x, y, z, 0, 0, spawnpoint.rotation, plate:sub(1, 8)) and add this just before that line: if not spawnpoint.rotation then spawnpoint.rotation = 0 end
  8. This information should be in the opening post, it's your fault that this problem is not solved yet... delete line 14 change line 15 to local speed = 0.5 Predicting your future problems: - its to slow/fast – change 0.5 to different value - I need to tap s for it to work – use onClientRender or setTimer + detecting if the key is pressed - I want it to accelerate – use math to change the value of speed based on the current conditions good luck.
  9. woops... function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z end function backwards() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 498 then toggleControl ( "brake_reverse", false ) local x,y,z = getElementPosition(veh) local vx,vy,vz = getElementVelocity(veh) local speed = (vx^2 + vy^2 + vz^2)^0.5 vx,vy,vz = getPositionFromElementOffset(veh,0,-speed,0) setElementVelocity(veh,vx-x,vy-y,vz-z) end end end bindKey("s", "down", backwards)
  10. function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z end function backwards() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 498 then toggleControl ( "brake_reverse", false ) local vx,vy,vz = getElementVelocity(veh) local speed = (vx^2 + vy^2 + vz^2)^0.5 vx,vy,vz = getPositionFromElementOffset(veh,0,-speed,0) setElementVelocity(veh,vx,vy,vz) end end end bindKey("s", "down", backwards)
  11. Not tested, but I think that you can exploit the CEF to download some files directly (website - > client): Images: local webBrowser = createBrowser(Width, Height, false, false) -- Width, Height of the image addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "http://direct_hotlink_to_image.png") --note that at this point the user will likely revive a dialog to whitelist the domain, and the rest of the script will fail if he doesn't... --also there will be problems if the hosting site contains adds... end) addEventHandler ( "onClientBrowserDocumentReady" , root , function ( url ) --domain already whitelisted if source == webBrowser then encodeImage() end end) addEventHandler ( "onClientBrowserWhitelistChange" , root , function( url ) --domain whitelisted by the user if source == webBrowser then encodeImage() end end) function encodeImage() local data = dxGetTexturePixels(webBrowser) destroyElement(webBrowser) local newImg = fileCreate('img.png') fileWrite(newImg, data) fileClose(newImg) end Small text files (less then 2mb): local webBrowser = createBrowser(Width, Height, false, false) -- Width, Height do not matter addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "http://direct_hotlink_to_file.txt") --note that at this point the user will likely revive a dialog to whitelist the domain, and the rest of the script will fail if he doesn't... --also there will be problems if the hosting site contains adds... end) addEventHandler ( "onClientBrowserDocumentReady" , root , function ( url ) --domain already whitelisted if source == webBrowser then getBrowserSource(webBrowser, encodeFile(code)) end end) addEventHandler ( "onClientBrowserWhitelistChange" , root , function( url ) --domain whitelisted by the user if source == webBrowser then getBrowserSource(webBrowser, encodeFile(code)) end end) function encodeFile(code) destroyElement(webBrowser) local newtxt = fileCreate('test.txt') fileWrite(newtxt, data) fileClose(newtxt) end
  12. The GTA:SA engine was newer designed to support more then one camera, so making a perfect mirror is not possible even with the Ren's script. The only idea tat come's to mind should allow to simulate left or right side mirror with full FPS and no sound issues (but testing is required): 1) You set the camera matrix to its max FOV (180) and rotate the center of viewpoint until the left (or right) side of the 180 viewpoint would show the same as 70(default) viewpoint. 2) You get the screen source. 3) You create two render targets (one full screen and one for the mirror). 4) You cut the 70/180% of the screen source from the left (or right depending on the rotation from step one), you stretch it and draw on the full screen render target 5) You cut some from the other side of the screen source and draw it to the other render target. I don't know if you understand what I mean, but in theory this should work, but there may be some other problems witch this (stretched default HUD, low quality dune to stretching and such).
  13. The script in that video was a concept made back in 2011! with many flaws, you can download the source code if you haven't yet: https://community.multitheftauto.com/index.php?p= ... ls&id=2870 There where no shader functions in it, I just wanted to find a use for dxCreateScreenSource. The main problem is that you have to devote some frames to simulate the second camera, and you need a way to render the correct image in the right place (I used 2 render targets, one is full screen and the other is the mirror)
  14. I think this should be all the files: https://dysk.onet.pl/link/EL6q2 I downloaded this about 10 months ago.
  15. http://2paq.byethost11.com/news.php This website displays in everything except MTA CEF, and i tested other website on this domain - the same problem... EDIT: Well - problem solved (for good I hope) all I needed to do was to change the hosting... So I DO NOT recommend byethost to anyone!
×
×
  • Create New...