Burak5312

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Burak5312

  • Rank
    Vic
  1. Burak5312

    warnings

    @MrTasty hm okey thanks again
  2. Burak5312

    warnings

    @MrTasty thanks for answer i solved problem but 2 eventhandler make me trouble? performance lost or something?
  3. Burak5312

    warnings

    hello my code working good but giving warning like that thank you and i have questions 1- possible this function export as textlibrary? 2- and this code correct? text_c.Lua local x,y = guiGetScreenSize() local a = 255 function drawText() dxDrawText("LEVEL UP!", x/2, y/2, x/2, y/2, tocolor(255,255,255,255), 2, "bankgothic", "center", "center") fadetimer = setTimer(function() removeEventHandler("onClientRender", root, drawText) if(isTimer(fadetimer)) then killTimer(fadetimer) end addEventHandler("onClientRender", root,fadeText) end, 5000, 1) function fadeText() if not (a == 0) then dxDrawText("LEVEL UP!", x/2, y/2, x/2, y/2, tocolor(255,255,255,a), 2, "bankgothic", "center", "center") a = a - 5 destroytimer = setTimer(function() removeEventHandler("onClientRender", root, fadeText) if(isTimer(destroyTimer)) then killTimer(destroytimer) end end, 8000, 1) end end end addEventHandler("onClientRender", root, drawText)
  4. hello I have a problem i create ped /boomer command following player but rejoin server ped wont move server function spawnBoomer(thePlayer) playerX, playerY, playerZ = getElementPosition(thePlayer) boomer = createPed(114, playerX + 5, playerY, playerZ) local bX, bY, bZ = getElementPosition(boomer) myBlip = createBlipAttachedTo(boomer, 23) exports.extra_health:setElementExtraHealth(boomer, 2000) function OnPedWasted () if ( isPedDead ( boomer) ) then x, y, z = getElementPosition(boomer) createExplosion(x, y, z, 11) destroyElement(boomer) destroyElement(myBlip) triggerClientEvent ( thePlayer, "pedWasted", thePlayer, x, y, z ) end end addEventHandler("onPedWasted", boomer, OnPedWasted ) function BoomerDirectionUpdate() local pX,pY,pZ = getElementPosition(thePlayer) local bX,bY,bZ = getElementPosition(boomer) if(not isPedDead(boomer)) then triggerClientEvent(thePlayer, "BoomerDirection", thePlayer, boomer, pX ,pY ,pZ ,bX ,bY ,bZ) end end setTimer(BoomerDirectionUpdate,50,0) function BoomerStartFollow() local pX,pY,pZ = getElementPosition(thePlayer) local bX,bY,bZ = getElementPosition(boomer) if(not isPedDead(boomer)) then triggerClientEvent(thePlayer, "BoomerStartRun", thePlayer, boomer, pX ,pY ,pZ ,bX ,bY ,bZ) end end setTimer(BoomerStartFollow,50,0) end addCommandHandler("boomer", spawnBoomer) function skinBoomer() txd = engineLoadTXD ("boomer.txd") engineImportTXD ( txd, 114 ) dff = engineLoadDFF ("boomer.dff") engineReplaceModel (dff, 114) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),skinBoomer) function boomerDeathExplode( x, y, z ) fxAddDebris(x, y, z, 255, 0, 0, 255, 0.1, 200) end addEvent( "pedWasted", true ) addEventHandler( "pedWasted", localPlayer, boomerDeathExplode) function BoomerDirectionHandler(boomer) local pX,pY,pZ = getElementPosition(localPlayer) local bX,bY,bZ = getElementPosition(boomer) local distance = getDistanceBetweenPoints3D(pX, pY, pZ, bX, bY, bZ) if(distance < 30) then intPedRot = -math.deg (math.atan2(pX - bX, pY - bY)) if intPedRot < 0 then intPedRot = intPedRot + 360 end; setElementRotation (boomer, 0, 0, intPedRot, 'default', true) end end addEvent("BoomerDirection", true) addEventHandler("BoomerDirection", localPlayer, BoomerDirectionHandler) function BoomerRunPunch(boomer) local pX,pY,pZ = getElementPosition(localPlayer) local bX,bY,bZ = getElementPosition(boomer) local distance = getDistanceBetweenPoints3D(pX, pY, pZ, bX, bY, bZ) if(distance < 50) then setPedControlState(boomer, "forwards", true) else setPedControlState(boomer, "forwards", false) end end addEvent("BoomerStartRun", true) addEventHandler("BoomerStartRun", localPlayer, BoomerRunPunch) client