Jump to content

Gaimo

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by Gaimo

  1. I solved the problem by doing this: function dxNewDrawText(...) arg = {...} arg[4] = arg[2] + arg[4] arg[5] = arg[3] + arg[5] dxDrawText(unpack(arg)) end But I would like to understand the reason to use end position.
  2. What would be the performance difference between customData and setElementData with addElementDataSubscriber?
  3. Gaimo

    [REL] Ball

    Add kick animation - Any animation suggestions, I don't know how to create animations. Add a power bar - This one is good for changing the ball's distance. Add a way to guide the ball while running - This one I don't exactly know how to do. why don't you share your ressource on the mta community ? I'm too lazy to put the information in meta.xml I use Google Translate.
  4. All function related to physics are unavailable yet right? local terrainData = { 3,3,3,3, 3,0,0,3, 3,0,0,3, 3,3,3,3, } local terrainShape = physicsCreateShape(physics, "heightfieldterrain", 4,4, terrainData) local terrain = physicsCreateStaticCollision(terrainShape) physicsSetProperties(terrain, "position", 0,0,5) physicsSetProperties(terrain, "scale", 5,5,1) -- in terrain, sets mesh density, now mesh has size 20x20units, one vertex every 5 units With this script plus shader it would be possible to create custom terrains, right?
  5. Gaimo

    check jump

    local tick = getTickCount() local delay = 150 -- ms local jump = false addEventHandler("onClientRender", root, function() if getTickCount() - tick > delay then if getPedControlState(localPlayer, "jump") and not jump then outputChatBox("jump") jump = true elseif not getPedControlState(localPlayer, "jump") and jump then jump = false end tick = getTickCount() end end) So you can detect, regardless of the key that the player presses.
  6. I know an HTML HUD might not be the best option, I'm still sharing it in case anyone wanted to see some HTML resource as an example. Download
  7. I converted the mod from gta sa to mta -> original mod mta version -> download
  8. Debugscript 3 limpo, feito em DGS, descompilado. Contato: Gaimo#0152 - discord
  9. A simple RP for removing trash from the beach. full server-side, you get $ 50 for every garbage collected, you need pAttach. Any bug found can report here. Download
  10. local object = createObject(1265, 0,0,3) setElementVelocity(object, 0,0,0) wiki createObject Note: Dynamic objects do not automatically have physics applied to them. Use setElementVelocity(object, 0, 0, 0) to fix this. would it be a bug?
  11. local function removeShadow(vehicle) local shader = dxCreateShader("files/replace.fx", 0, 0, false, "vehicle") local texture = dxCreateTexture("files/remove.png") dxSetShaderValue(shader, "gTexture", texture) engineApplyShaderToWorldTexture(shader, "shad_car", vehicle) end and local function removeShadow(vehicle) local shader = dxCreateShader("files/replace.fx", 0, 0, false) local texture = dxCreateTexture("files/remove.png") dxSetShaderValue(shader, "gTexture", texture) engineApplyShaderToWorldTexture(shader, "shad_car", localPlayer) end Neither worked, I want to remove the shadow of a specific vehicle, not all. The texture name of the shadow I know is "shad_car" And this replace shader works because I used it in other things, I just don't understand why it didn't work for the shade. Any solution?
  12. My voice resource is this https://community.multitheftauto.com/index.php?p=resources&s=details&id=15958 I couldn't test it, but does it work? CLIENT-SIDE: addEventHandler("onClientElementStreamIn", root, function () if source:getType() == "player" then if getElementData(source, "call") then return end triggerServerEvent("proximity-voice::broadcastUpdate", localPlayer, getElementsByType("player", root, true)) end end ) addEventHandler("onClientElementStreamOut", root, function () if source:getType() == "player" then if getElementData(source, "call") then return end triggerServerEvent("proximity-voice::broadcastUpdate", localPlayer, getElementsByType("player", root, true)) setSoundPan(source, 0) setSoundVolume(source, 0) end end ) SERVER-SIDE: addCommandHandler("call", function(plr, cmd, target) local target = getPlayerFromPartialName(target) -- return a player setElementData(plr, "call", true) setElementData(target, "call", true) setPlayerVoiceBroadcastTo(plr, target) setPlayerVoiceBroadcastTo(target, plr) end)
  13. A simple vehicle alarm system. I accept suggestions for improvements. Demo: NOTE: It is only possible to open the dashboard after you leave a vehicle as a driver. [Download] UPDATE #1 - Fixed an issue that the menu was not open.
  14. I have a suggestion, don't delete the data immediately when the player disconnects, my system to save the player's position is only activated when the player disconnects and I lose the player's id.
  15. I had problem with this shader, there is even a message from me in this post. shader line 13,9 -> sampler Sampler0 = sampler_state
  16. I tried to make a normal replacement like any model but it didn't work.
  17. Code: local obj local shader = dxCreateShader("shader.fx", 0, 0, false) function positioning() local x,y,z = getPositionFromElementOffset(localPlayer, 0, 1.2, 0) local rx,ry,rz = getElementRotation(localPlayer) setElementPosition(obj, x,y,z) setElementRotation(obj, rx,ry,rz) end function setItemPosition(button, press) if button == "mouse1" and press then setElementAlpha(obj, 255) setElementCollisionsEnabled(obj, true) engineApplyShaderToWorldTexture(shader, "crate128") dxSetShaderValue(shader, "gColor", 255, 255, 255, 255) removeEventHandler("onClientRender",root, positioning) removeEventHandler("onClientKey",root, setItemPosition) end end function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform 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 -- Return the transformed point end addCommandHandler("criar", function() local x,y,z = getPositionFromElementOffset(localPlayer, 0, 1.2, 0) local rx,ry,rz = getElementRotation(localPlayer) obj = createObject(1224, x,y,z,rx,ry,rz) setElementAlpha(obj, 141) setElementCollisionsEnabled(obj, false) engineApplyShaderToWorldTexture(shader, "crate128") dxSetShaderValue(shader, "gColor", 0, 255, 0, 200) addEventHandler("onClientRender",root, positioning) addEventHandler("onClientKey",root, setItemPosition) end) Error: I am starting the script and this warning already appears. shader line 13,9 -> sampler Sampler0 = sampler_state
  18. I think the easiest thing would be to add a ped with alpha 0 and remove it when the player enters. I don't know if I would know how to do this reverse engineering.
  19. Really, I will try to do a test with a settimer, and return.
  20. addEventHandler("onClientVehicleStartExit", getRootElement(), function() local x,y,z = getVehicleComponentRotation(source, "wheel_lf_dummy") local x1,y1,z1 = getVehicleComponentRotation(source, "wheel_rf_dummy") outputChatBox(x) -- work print(setVehicleComponentRotation(source, "wheel_lf_dummy", x, y, z) ) -- true setVehicleComponentRotation(source, "wheel_rf_dummy", x1, y1, z1) end) The script has no error. Returns the rotation of the wheel, returns true in the setVehicleComponentRotation but the wheel is not rotated. What is happening? Result I'm looking for:
  21. Estou editando um script de primeira pessoa, mas tem um problema, quando o jogador mira em terceira pessoa (padrão do jogo) a arma acompanha a direção de onde esta a mira e se atirar a munição será disparada naquela direção, mas com o modo primeira pessoa, quando o jogador mira a arma vai apontar para frente e não importa a direção que você esta apontando com a câmera o tiro vai ir na direção que foi clicado para mirar, qual função eu devo usar para atualizar a direção igual acontece em terceira pessoa ? O mais próximo que eu consegui foi atualizar a rotação do personagem, mas só funciona no eixo X (horizontal) se colocar para cima e para baixo o boneco vai ficar muito zoado. Pensei nas funções: setPedAimTarget e setPedLookAt setPedLookAt provavelmente não funciona já que é para mover a cabeça do jogador. Segue o vídeo para entender melhor o meu problema: Segue o script:
  22. Can't use the same txd? it is used in both dff.
×
×
  • Create New...