• Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About maximumdrive

  • Rank

Recent Profile Visitors

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

  1. maximumdrive

    [WIP] Vehicle Realism System

    Is that still in progress?
  2. maximumdrive

    Getting an applied shader/texture's world position?

    Look, just imagine a vehicle with the shader applied on it's specific part using engineApplyShaderToWorldTexture(). I just want to know if it is possible to know the world position of that point, where the shader is applied. UPD: I just thought of getting pixels/screen position and using getWorldFromScreenPosition(), but I don't know in which way could I use that correctly.
  3. Hi all, is it possible to get a world position of a shader, applied to the only one object? Easier to say, is there a kind of an getElementPosition() analogue or the way to create it, which could allow to know applied shader's/object's specified texture's world position?
  4. Hi all, there is a well-known function warpPedIntoVehicle() which warps player into the car looking it like it was occupying that for ages. But is there a function which makes ped entering the vehicle in a kind of 'animated' way, as it is when onClientVehicleStartEnter is triggered? Easier to explain: is it possible to force the player/ped to enter a nearby staying vehicle in a normal, non-warping way?
  5. maximumdrive

    Getting position of "ped_frontseat"?

    Thanks, I don't know why I haven't noticed that moment... So the right-steering scripting idea seems to be impossible 😥
  6. maximumdrive

    Getting position of "ped_frontseat"?

    Hi all, I'm trying to use getVehicleComponentPosition() to move the driver's position for making middle-/right-seating vehicles. But the problem is that the getVehicleComponentPosition(vehicle, "ped_frontseat") returns false twice instead of x and y, and nil instead of z. That works fine with etVehicleComponentPosition(vehicle, "door_lf_dummy") local vehicle = getPedOccupiedVehicle(localPlayer) local cx, cy, cz = getVehicleComponentPosition(vehicle, "door_lf_dummy") -- works fine local csx, csy, csz = getVehicleComponentPosition(vehicle, "ped_frontseat") -- returns false, false, nil I've even tried to move ped_frontseat to a 'chasis'-container in the vehicle's model, but it doesn't cause any positive result. Somebody please tell me if it is possible to solve.
  7. Hi all, I'm creating a cross-model tuning system, which allows using components of another vehicle's model. Generally it's OK, but I've noticed that the component position influences not only the "target-vehicle", but also it generates component's positioning bugs in ALL vehicles of the same model. My question is theoretical: does the setVehicleComponentPosition/-Rotation() work with the vehicle object, or it runs on a kind of "model ID" level, affecting all vehicles of 'that' model? If not, in which way could I create a kind of sync-issue? onClientElementDataChange-tablesync etc?
  8. maximumdrive

    [HELP] getVehicleComponents() bug?

    I've already tried that on client, but perhaps it could be successful somewhere on server, thanks for idea.
  9. maximumdrive

    [HELP] getVehicleComponents() bug?

    Oh, now it's clear: the problem is, that the getPedOccupiedVehicle() works really fine, but when I try to create another vehicle it doesn't work for a newly-created serverside vehicle. But it creates, it's model successfully outputs to chatbox, but getVehicleComponents()'s length is "0"... The clientside code is the same as yours now. E.g. (Server): addCommandHandler("gvc", function (player) local pVeh = getPedOccupiedVehicle(player) local seat = getPedOccupiedVehicleSeat(player) if pVeh and seat == 0 then local px, py, pz = getElementPosition(pVeh) local px, py, pz = getElementRotation(pVeh) local v = createVehicle(405, px, py, pz-20, rx, ry, rz) setElementFrozen(v, true) setElementCollisionsEnabled(v, false) setVehicleLocked(v, true) attachElements(v, pVeh, 0, 0, -6, 0, 0, 0) triggerClientEvent(player, "onClientGetVehicleComp", player, v) end end)
  10. maximumdrive

    [HELP] getVehicleComponents() bug?

    Hi all, my question is so close to be "stupid/funny", but I wasted several hours to fight those lines. Here is a clientside function handling an event. Element's model is viewed to *debug* if the vehicle comes from server. The problem is that the vehicle exists, model also does, but the length of *sincerely beloved* getVehicleComponents(veh) is always "0"! It only can type component's list when the function is "bouned" on a key which has to be pushed for tens of times to meet a success! The "central surprise" is that the usage example of getVehicleComponents is taken from MTA Wiki and it fails! I've found some reports, so the components are in some way cached by MTA/GTA-single, so it could influence this simple code, but I can't even imagine what is the problem. I'm totally discouraged by such a mysticism and have no ideas about causes. Please, help. function tunBaseComp(veh) outputChatBox(tostring(getElementModel(veh))) local getComponent = getVehicleComponents(veh) if veh then for k in pairs(getComponent) do outputChatBox(k) end end end
  11. maximumdrive

    DFF-encryption causes client's breakdowns. Efficient suggestions?

    Thank you! Great solution, the difference is indisputable, works super!
  12. Hi all, I've implemented some simple encoding solutions for vehicle models like "read base64+teaEncoded file->decrypt on client->engineLoadDff() with file's decoded raw data as an argument instead of filename". But the problem is, that our tuning system is large and makes non-encrypted DFF's sizes in some cases ~50-100MB (all parts are built into the vehicle's DFFs and shown via setVehicleComponentVisible()), so encrypted versions get about +80-90% of their own "weight", e.g. 65MB-DFF will be ~110MB because of encryption. That way causes performance troubles, performance browser isn't showing anything "bad" except 1.7GB cache's size. In several minutes after the player logged in the game crashes (obviously because of CPU/memory been flooded). Starting of the resources on clientside while cache is checked is also too "heavy" because of encryption, so many players can finally login only after several MTA client's brakedowns. Some experiments (using performance browser) have shown that restarting vehicle-resources after the player is ready with cache-check makes their "memory-consumption" be normal ~230-250KB (as non-encrypted analogues) instead of previous hundreds of megabytes. As I can assume, importing filebuffers in engineLoadDFF is also not that efficient: /reconnect-command is the worst idea for the moment, only complete MTA-restart can allow your 'relogin' without getting in troubles with MTA-crashes. I suspect that MTA can't collect all "trash" from the memory when using raw data instead of DFF-files. My colleagues don't think, that 1.7GB-cache is the main problem, they sent me tens of examples where the cache size can be about 3GB with no problems of that kind. Here is my code for that case, if I possibly have done some mistakes. So the main idea was to make client- and serverside files (serverside is needed to avoid visual mentioning of base64's key in client's cache). onClientResourceStart() triggers serverside event which triggers a client's one sending key to start decryption (numerous 'nils' I pasted there to dereference "large" variables manually trying to solve the performance-problem): function getVehicleKey(key) local fName = "model.dff" local modelID = 409 local buffer = "" local hFile = fileOpen(fName) if hFile then buffer = fileRead(hFile, fileGetSize(hFile)) fileClose(hFile) hFile = nil else outputConsole("DFF couldn't be loaded!") end local txd = engineLoadTXD('tex.txd',true) engineImportTXD(txd, modelID) local dff = engineLoadDFF(base64Decode( teaDecode( buffer, key ) )) buffer = nil engineReplaceModel(dff, modelID) dff = nil end addEvent("decryptCar", true) addEventHandler("decryptCar", localPlayer, getVehicleKey) addEventHandler('onClientResourceStart', resourceRoot, function() triggerServerEvent("sendVehicleKey", localPlayer, localPlayer) end ) Serverside's the only thing to do: function sendK(lp) local key = "keyishere" triggerClientEvent(lp, "decryptCar", lp, key) end addEvent("sendVehicleKey", true) addEventHandler("sendVehicleKey", root, sendK) Please help.
  13. maximumdrive

    [HELP] Clientside outputChatBox

    Hi Galactix, try triggering client events with your argument's places changed, e.g. triggerClientEvent(theDrugPlayer, heroinOffMessage) As the Wiki says, trigger-target should be written at first in the args list.
  14. maximumdrive

    [HELP] engineLoadDFF using raw data

    Didn't notice my fail while filling the 'buffer' LOL Then the question: how can I do it correctly? Debug swears on "glueing" the filefragments done in the next way. How can I attach binary bytesets into a complete raw data? while not fileIsEOF(hFile) do -- as long as we're not at the end of the file... buffer = buffer..fileRead(hFile, 500) -- ... read the next 500 bytes... -- ... and output them to the console end fileClose(hFile)
  15. maximumdrive

    [HELP] engineLoadDFF using raw data

    Hi, I'm now trying to base64+teaEncode some of my models, the Wiki says that engineLoadDff can load not only DFFs, but the file buffer too. As a result, engineReplaceModel fails returning "false". So I have written some code to encode-decode the model data. Am I right with my understanding of "raw data" needed to give to engineLoadDff as an argument? P.S. I was looking for issue using forumsearch etc. for a long time, but I haven't found any analogues, everybody uses engineLoadDFF only with filename as argument. addEventHandler('onClientResourceStart', resourceRoot, function() local buffer local hFile = fileOpen("model.dff") -- attempt to open the file if hFile then -- check if it was successfully opened while not fileIsEOF(hFile) do -- as long as we're not at the end of the file... buffer = fileRead(hFile, 500) -- ... read the next 500 bytes... -- ... and output them to the console end fileClose(hFile) -- close the file once we're done with it else outputConsole("Unable to open the model file") end local enBuffer = teaEncode( base64Encode( buffer ), "xTN5#Gqm=sKn**dF" ) local deBuffer = base64Decode( teaDecode( enBuffer, "xTN5#Gqm=sKn**dF" ) ) local txd = engineLoadTXD('tex.txd',true) engineImportTXD(txd, 596) local dff = engineLoadDFF(deBuffer) engineReplaceModel(dff, 596) end )