Jump to content

Burak5312

Members
  • Posts

    361
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by Burak5312

  1. marker = createMarker(2169.62500, -1983.23706, 13.55469, "cylinder", 1)
    vehicles = {}
    
    addEventHandler("onMarkerHit", marker, function(player)
        vehicles[player] = createVehicle(408, 2169.62500 + 3, -1983.23706, 13.55469)
    end)
    
    addEventHandler("onPlayerQuit", root, function(type)
       if (type == "Quit") then 
        destroyElement(vehicles[source]) --change player to source
       end
    end)

     

    • Thanks 1
  2. local lamppostList = {
    	[1126] = true --enter lamp post ids
    }
    
    setTimer(
    	function()
    	local pVeh = getPedOccupiedVehicle(localPlayer) -- Get the players vehicle
    	for i,v in pairs(getElementsByType("object", root, true)) do
    	   if (isElement(v)) and (getElementType(v) == "object") and (lamppostList[getElementModel(v)]) then
    	      if(pVeh) then 
    			setElementCollidableWith(pVeh,v, false) 
    			setElementCollidableWith(v,pVeh, false) 
              end
           end
        end
    end,
    500, 0)

    can you try this

    • Like 1
  3. triggerServerEvent("attemptLogin", resourceRoot, Data[1][1], hashedPass)
    
    local passVerified = passwordVerify(passHashFromDB, pass)

    you are comparing hash to hash this function asks for the password in plain text so don't encrypt it on client side

    --local hashedPass = passwordHash(Data[1][2], "bcrypt",{}) --this

     

  4. can you show more code

    setElementDimension(client, 0)
    setElementData(client, "player.isCharCreator", false)
    setElementData(client, "player.sex", charTable[4])
    if charTable[4] then
       setPedWalkingStyle(client, 118)
    else
       setPedWalkingStyle(client, 129)
    end
    setElementData(client, "player.skin", charTable[7])
    local skin = tonumber(charTable[7])
    --setElementModel(player, skin) --no need this
    setElementData(client, "player.pame", charTable[8])
    setElementData(client, "player.isCharCreator", false)
    spawnPlayer(client, 233.5927734375, -1278.25, 6.351, -100, skin, 0, 0) --use spawnPlayer skin parameter
    fadeCamera(client, true)
    setCameraTarget(client)

    by the way, you don't need to use setElementModel, spawnPlayer function has skin parameter for it

    • Like 1
  5. setElementData(client, "player.isCharCreator", false)--working good
    setElementData(client, "player.sex", charTable[4])--working good
    if charTable[4] then
       setPedWalkingStyle(client, 118)--working too
    else
       setPedWalkingStyle(client, 129)--working too
    end
    setElementData(client, "player.skin", charTable[7])
    print(charTable[7]) --show me what is charTable[7]
    local skin = tonumber(charTable[7])
    setElementModel(client, skin)--didn't work

    Can you debug the CharTable[7] data

  6. 1 hour ago, ironimust said:
    A web tool that compiles code, how will it hide model files?
    I have already hidden the files named .lua, only the model files are not hidden.
    
    [url=https://www.hizliresim.com/n1eehyo][img=https://i.hizliresim.com/n1eehyo.PNG][/url]
    
    [url=https://www.hizliresim.com/bxyrt6l][img=https://i.hizliresim.com/bxyrt6l.PNG][/url]
    
    [url=https://www.hizliresim.com/pchlmwu][img=https://i.hizliresim.com/pchlmwu.PNG][/url]
    

    try this for models https://mtaclub.eu/pcrypt

  7. addEventHandler("onClientVehicleEnter", root,
        function(player)
           local vehicleID = getElementModel(source)
           if(vehicleID == 425) then
              toggleControl("vehicle_fire", false) --rockets
              toggleControl("vehicle_secondary_fire", false) --hunter's minigun
           end
        end
    )
    
    addEventHandler("onClientVehicleExit", root,
        function(player)
           local vehicleID = getElementModel(source)
           if(vehicleID == 425) then
              toggleControl("vehicle_fire", true) --rockets
              toggleControl("vehicle_secondary_fire", true)  --hunter's minigun
           end
        end
    )

     

    you can do it this way i didn't test it but

    • Like 1
  8. 1 hour ago, ironimust said:

    I don't know much. Can you make this code compatible with dbConnect or can you post a working mysql connection script?

    can you show the code and also show the error you got let's see what we can do

  9. addEvent("startMinerJob", true)
    
    
    function startJob(thePlayer)
    
      if not (getElementData(thePlayer, "Jobs") == "miner") then 
         setElementData(thePlayer, "Jobs", "miner")
      end
    
        function plant(thePlayer)
    
    
    
            if (getElementData(thePlayer, "Jobs") == "miner") then 
                x, y, z = getElementPosition(thePlayer)
    
                disx = 611.54028
                disy = 878.61017
                disz = -42.9609
    
                if (getDistanceBetweenPoints3D(x, y, z, disx, disy, disz) < 90) then 
    
                    outputChatBox("Bomb Planted!", thePlayer, 255, 0, 0)
    
               setTimer(function()
    
                   createExplosion(x, y, z, 10)
            
       
                   stone1 = createObject(3930, x+0,   y+1, z-0.5)
                   stone2 = createObject(3930, x+1*2, y+3, z-0.5)
                   stone3 = createObject(3930, x+2*2, y+2, z-0.5)
                   stone4 = createObject(3930, x+3*2, y+5, z-0.5)
                   stone5 = createObject(3930, x+4*2, y+4, z-0.5)
       
                   x1, y1, z1 =  getElementPosition(stone1)
                   x2, y2, z2 =  getElementPosition(stone2)
                   x3, y3, z3 =  getElementPosition(stone3)
                   x4, y4, z4 =  getElementPosition(stone4)
                   x5, y5, z5 =  getElementPosition(stone5)
       
                   marker1 = createMarker(x1, y1, z1, "cylinder", 1.0, 0, 0, 0, 0)
                   marker2 = createMarker(x2, y2, z2, "cylinder", 1.0, 0, 0, 0, 0)
                   marker3 = createMarker(x3, y3, z3, "cylinder", 1.0, 0, 0, 0, 0)
                   marker4 = createMarker(x4, y4, z4, "cylinder", 1.0, 0, 0, 0, 0)
                   marker5 = createMarker(x5, y5, z5, "cylinder", 1.0, 0, 0, 0, 0)
       
                   addEventHandler("onMarkerHit", marker1, function(thePlayer)
               
                     setPedFrozen(thePlayer, true)
                     setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false)
                     destroyElement(marker1)
       
                      setTimer(function(stone1)
    
                         destroyElement(stone1)
                         setPedFrozen(thePlayer, false)
                         givePlayerMoney(thePlayer, 300)
    
                      end, 3000, 1,stone1)
               
                    end)
       
                   addEventHandler("onMarkerHit", marker2, function(thePlayer)
               
                   setPedFrozen(thePlayer, true)
                   setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false)
                   destroyElement(marker2)
       
                   setTimer(function(stone2)
                       destroyElement(stone2)
                       setPedFrozen(thePlayer, false)
                       givePlayerMoney(thePlayer, 300)
                   end, 3000, 1,stone2)
               
                   end)
       
                   addEventHandler("onMarkerHit", marker3, function(thePlayer)
               
                   setPedFrozen(thePlayer, true)
                   setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false)
                   destroyElement(marker3)
       
                   setTimer(function(stone3)
                       destroyElement(stone3)
                       setPedFrozen(thePlayer, false)
                       givePlayerMoney(thePlayer, 300)
                   end, 3000, 1,stone3)
               
                   end)
       
                  addEventHandler("onMarkerHit", marker4, function(thePlayer)
               
                   setPedFrozen(thePlayer, true)
                   setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false)
                   destroyElement(marker4)
       
                   setTimer(function(stone4)
                       destroyElement(stone4)
                       setPedFrozen(thePlayer, false)
                       givePlayerMoney(thePlayer, 300)
                   end, 3000, 1,stone4)
               
                   end)
       
                   addEventHandler("onMarkerHit", marker5, function(thePlayer)
               
                   setPedFrozen(thePlayer, true)
                   setPedAnimation(thePlayer, "FIGHT_B", "FightB_G", -1, false, false, false, false)
                   destroyElement(marker5)
       
                   setTimer(function(stone5)
                       destroyElement(stone5)
                       setPedFrozen(thePlayer, false)
                       givePlayerMoney(thePlayer, 300)
                   end, 3000, 1, stone5)
               
                   end)
       
         
                end, 5000, 1)
    
                end
    
            
    
            end
    
    
        end
    
      addCommandHandler("plant", plant)
    
    end
    
    addEventHandler("startMinerJob", root, startJob)
    
    
    
    
    --[[ Leave Miner Job Section  ]]
    addEvent("leaveMinerJob", true)
    function leaveJob(thePlayer)
       if (getElementData(thePlayer, "Jobs") == "miner") then 
    
          setElementData(thePlayer, "Jobs", nil)
          outputChatBox("you leaved miner job!", thePlayer, 0, 255, 0)
    
       end
    end
    addEventHandler("leaveMinerJob", root, leaveJob)

    try this

  10. loadstring(exports.dgs:dgsImportFunction())()
    
    local IsOn = false
    local sW, sH = dgsGetScreenSize()
    
    function doPhone()
       if(IsOn) then return end
       rrn = dgsCreateRoundRect(30,false, tocolor(0,0,0,255))
       phone = dgsCreateImage( sW * 0.7, sH * 0.5, sW * 0.20, sH * 0.50, rrn, false)
       app_texture1 = dxCreateTexture("ohnoe.jpg")
       app1 = dgsCreateRoundRect(30,false, tocolor(255,255,255,255))
       app = dgsCreateImage( sW * 0.750, sH * 0.650, sW * 0.10, sH * 0.15, app1, false)
       app_button = dgsCreateButton(  sW * 0.750, sH * 0.650, sW * 0.10, sH * 0.15, "", false, _, tocolor(0,0,0,0) )
       dgsRoundRectSetTexture(app1, app_texture1)
       dgsSetLayer (app_button,"top")
       dgsSetAlpha(app_button, 0)
       addEventHandler("onDgsMouseClickDown", app_button, app1Func)
       IsOn = true
       -- animations 
    end
    
    function removePhone()
       if(not IsOn) then return end
       removeEventHandler("onDgsMouseClickDown", app_button, app1Func)
       destroyElement(rrn)
       destroyElement(phone)
       destroyElement(app_texture1)
       destroyElement(app1)
       destroyElement(app)
       destroyElement(app_button)
       IsOn = false
    end
    
    function togglePhone()
       if(IsOn) then
          removePhone()
       else
          doPhone()
       end
    end
    bindKey("n", "down", togglePhone) 
    
    function app1Func()
        outputChatBox("hey")
    end

     

    I didn't test it but can you try this

    • Thanks 1
  11. for some reason collision is not detected because the marker is small set the size of the marker to 1.5 to fix this issue

    or if you want to keep the marker small, create a colshape and reference the collision to the colshape

    local e1 = createMarker(2105.47534, -1806.58765, 12.55469, "cylinder", 1.5, 255, 255, 255, 50) 
    local e = createMarker(362.98032, -75.25889, 1000.50781, "cylinder", 1.5, 255, 255, 255, 50)
    setElementInterior(e, 10) 
    
    -- INSIDE
    addEventHandler("onMarkerHit", e1, 
        function(hitElement, matchingDimension)
           if(getElementType(hitElement) == "player") then
              setElementInterior(hitElement, 10) 
              setElementPosition(hitElement, 365.33194, -73.90823, 1001.50781) 
           end
        end
    )
    -- OUTSIDE
    addEventHandler("onMarkerHit", e,
        function(hitElement, matchingDimension)
           if(getElementType(hitElement) == "player") then 
              setElementInterior(hitElement, 0) 
              setElementPosition(hitElement, 2100.90894, -1806.63440, 13.55469) 
           end
        end
    )

     

    • Thanks 1
  12. the player in your code is ambiguous if you want to do it for all players then pull all players with for loop like this

    if you're going to do this for a single player it depends on the situation instead you should explain it

    function Kamshodan()
        setTimer(
           function()
              for _,player in pairs(getElementsByType("player")) do
                 setPedStat(player, 23, getPedStat ( player, 23 ) - 2)
                 setPedStat(player, 22, getPedStat ( player, 22 ) + 2)
              end
           end,3600, 1)
        end
    addEventHandler ('onResourceStart', getRootElement(), Kamshodan)
  13. 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
    
    x,y,z = getElementPosition(localPlayer)
    
    local camera = createObject(367,x, y, z)
    
    
    function updatePed()
    
        
        setElementBoneRotation(localPlayer,22,0, -60, 0)
    
        setElementBoneRotation(localPlayer,23,90, -100, 80)
    
        setElementBoneRotation(localPlayer,24,80, 30, 0)
    
        setElementBoneRotation(localPlayer,32,0, -85, 10)
    
        setElementBoneRotation(localPlayer,33,-70, -108, -30)
    
        updateElementRpHAnim (localPlayer)
    
    addEventHandler ("onClientPedsProcessed", getRootElement(), updatePed)
    
    end
    
    addCommandHandler("setanim1",updatePed)
    
    
    function dadancamera()
    
        setElementData(camera,"startlive",true)
    
        --triggerServerEvent("messagelive",root)
        
        exports.bone_attach:attachElementToBone(camera,localPlayer,1, 0.15, 0.25, -0.1, 0, 0, 90)
        
    end
    
    
    addCommandHandler("setanim1",dadancamera)
    
    
    function updatePed2()
    
    
    removeEventHandler("onClientPedsProcessed", getRootElement(), updatePed)
    
    destroyElement(camera)
    
    end
    
    addCommandHandler("setanim2",updatePed2)
    
    
    function didanlive()
    
        if getElementData(camera,"startlive") == true then
    
          addEventHandler ( "onClientRender", root, didanlive )
    
          x,y,z = getElementPosition(localPlayer)
    
          x2,y2,z2 = getElementPosition(camera)
    
          x4,y4,z4 = getElementRotation(camera)
          local _,_, pRotZ = getElementRotation(localPlayer)
          local fx, fy, fz = getPositionFromElementOffset(camera, 10,0,0)
    
          setCameraMatrix(x2,y2,z2, fx,fy,fz)
          
    end
    
    end
    
    addCommandHandler("live",didanlive)
    
    
    function camset()
    
      setCameraTarget(localPlayer)
      removeEventHandler ( "onClientRender", root, didanlive )
    
    
    end
    
    
    addCommandHandler("ended",camset)

    can you try this

×
×
  • Create New...