Jump to content

Volltron

Members
  • Posts

    25
  • Joined

  • Last visited

Recent Profile Visitors

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

Volltron's Achievements

Advanced Member

Advanced Member (8/54)

1

Reputation

  1. I'm trying to make the ped crawl from underground when it spawns, I'm using the timers to be able to change the animation and the animation speed since the climbing one is split. And I use setElementPosition to move the ped up so the next part of the climbing animation doesn't start in the same place as the first one. I'll try any recommendations, but I couldn't figure any other way of moving the ped up from under the ground while setting the climbing animation
  2. Hi, I was trying to make a script that spawns a ped underground and makes it crawl its way up, but the issue is that whenever the animation changes, it's not smooth, you can see the character glitching for a few frames. Code below: function spawnS(playerSource, commandName) local x, y, z = getElementPosition(playerSource) local sPed = createPed(19, x, y, z-2) setElementCollisionsEnabled(sPed, false) setTimer(function() setPedAnimation(sPed, "ped", "climb_pull",-1, false,true,false,false, 0, false) setTimer(setPedAnimationSpeed, 100, 1, sPed, "climb_pull", 0.4) setTimer(function() setElementPosition(sPed, x, y, z-1, true) setPedAnimation( sPed, "ped", "climb_stand", -1, false,false,false,false, 0, false) setTimer(function() setPedAnimationSpeed(sPed, "climb_stand", 0.5) setTimer(function() setElementCollisionsEnabled(sPed, true) setElementPosition(sPed, x, y, z, true) setPedAnimation( sPed, "ped", "climb_stand_finish", -1, false,true,false,false) end, 1400, 1) end, 100, 1) end, 2000, 1) end, 100, 1) end addCommandHandler("s", spawnS) Is there any way of achieving this ?
  3. I want to create a custom radar on which I can add blips and radarareas but I can't even get near that since I'm having trouble with the math, this is what I did so far -- Removing the hud radar -- local function hideRadar() setPlayerHudComponentVisible("radar", false) end addEventHandler("onClientResourceStart",resourceRoot,hideRadar) -- GPS -- local screenW, screenH = guiGetScreenSize() local mapImgWidth, mapImgHeight = 3072 , 3072 -- size of the world.jpg texture local minimapX, minimapY = 696, 364 -- test size of the radar local rt = dxCreateRenderTarget(541, 454) addEventHandler("onClientRender", root, function() local x, y = getElementPosition(getLocalPlayer()) -- player x, y coords local camX, camY, camZ = getElementRotation(getCamera()) -- player x, y ,z camera coords local plRotX, plRotY, plRotZ = getElementRotation(getLocalPlayer()) -- player rotation coords local minimapW, minimapH = dxGetMaterialSize(rt) dxSetRenderTarget(rt,true) dxDrawImageSection(0, 0, mapImgWidth, mapImgHeight, 0, 0, mapImgWidth, mapImgHeight, ":gps_remake/images/world.jpg") dxDrawImage(minimapW/2 - 30/2, minimapH/2 - 30/2, 30, 30, ":gps_remake/images/player.png", camZ- plRotZ) dxSetRenderTarget() dxDrawImage(minimapX, minimapY, minimapW, minimapH, rt); end ) How do I show the player location with the dxDrawImageSection
  4. I know, I've looked at it before this but it's not what i was looking for. I fixed it anyway by making an empty sniper scope with no crosshair and added a crosshair over it
  5. Same thing happens, but thank you anyway. I think there's just no way of getting rid of the black side bars when zooming in with the sniper
  6. Yes that's what I tried but the problem is the black bars and I was wondering if there's any way of just getting rid of them or if I have to get used to that and work with it https://i.imgur.com/2Vgw4w8.png
  7. I'm trying to change the whole sniper crosshair and scope but I get black bars instead of an empty screen when i aim with sniper Is there any way i can get rid of the black bars ? local shader = dxCreateShader("textureS.fx"); local texture = dxCreateTexture("empty.png"); dxSetShaderValue(shader, "crosshair_sniper", texture); engineApplyShaderToWorldTexture(shader, "snipercrosshair"); engineApplyShaderToWorldTexture(shader, "cameracrosshair"); https://i.imgur.com/gwD8ovY.png
  8. I did it and now it works, thanks for help ^^ I also had to put the event handlers for colshapes inside the create function to make it work
  9. Im struggling with how to use the values without declaring them local outside the function function createTreasure() local treasureRadar = createRadarArea( treasurePositions[randomRadar][1] - 25, treasurePositions[randomRadar][2] - 25, 50, 50, 255, 221, 0, 100) local treasureArea = createColRectangle( treasurePositions[randomRadar][1] - 25, treasurePositions[randomRadar][2] - 25, 50, 50) local treasureObject = createObject(2060, treasurePositions[randomRadar].tabel[randomTreasure][1], treasurePositions[randomRadar].tabel[randomTreasure][2], treasurePositions[randomRadar].tabel[randomTreasure][3] - 1) local treasureCol = createColSphere(treasurePositions[randomRadar].tabel[randomTreasure][1], treasurePositions[randomRadar].tabel[randomTreasure][2], treasurePositions[randomRadar].tabel[randomTreasure][3] - 1, 1.5) attachElements(treasureCol, treasureObject) if (treasureObject) then setObjectScale (treasureObject, 2) end end addEventHandler("onResourceStart", getRootElement(), createTreasure) addEventHandler("onColShapeHit", treasureArea, function(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing( treasureRadar, true ) end end ) addEventHandler("onColShapeLeave", treasureArea, function(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing( treasureRadar, false ) end end ) addEventHandler("onColShapeHit", treasureCol, function(thePlayer) local detect = isElementWithinColShape (thePlayer, treasureCol) if detect then outputChatBox("Write /dig to dig", thePlayer, 255,255,255 ) end end ) function playerDigTreasure(thePlayer, command) local detect = isElementWithinColShape (thePlayer, treasureCol) if detect then setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", -1, false, false, nil, false); setTimer( function() givePlayerMoney( thePlayer, 100000) destroyElement(treasureObject) destroyElement(treasureCol) destroyElement(treasureArea) destroyElement(treasureRadar) outputChatBox("Next treasure spawning in 5 seconds", getRootElement(), 255,255,255 ) setTimer(createTreasure, 5000, 1) end, 2000, 1) end end addCommandHandler("dig", playerDigTreasure)
  10. Yes but i want to make it so it only activates when the vehicle is upside down, i've tried using "onClientVehicleDamage" and "onClientVehicleCollision" when the car is turned 180(upside down) but it doesn't seem to trigger it
  11. Is it possible to stop vehicles from catching fire when they're upside down ? And if so what functions could I use ?
  12. I made it by canceling event and then subtracting the loss value from the other value but I'm still wondering if it's possible doing it while vehicle is damage proof
  13. I'm trying to make a script where another value takes the damage the vehicle gets instead of the vehicle's hp and I wanted to know if it's possible to make it so the player can "deal damage" to the other value as long as the vehicle is in "setVehicleDamageProof, true"
×
×
  • Create New...