Jump to content

[Ayuda]Barra de Vida SlothBot (zombihealth)


Narutimmy

Recommended Posts

Hola buenas, navegando en la comunidad me tope con este scrip

https://community.multitheftauto.com/ind ... w&pic=5388

5388.png

que muestra la vida de los zombis, lo que me preguntaba es como editarlo o hacer que solo funcione con los Slothbot? si ya saben como los juegos del ps2 y ps2, que al llegar con un jefe te salia una barra de vida en la parte superior y asi saber cuanta vida le queda :mrgreen:

Edited by Guest
Link to comment

Creo que es esta parte: No estoy seguro

    for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 

Probà asi.. Haber si funciona.

Link to comment
Creo que es esta parte: No estoy seguro
    for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 

Probà asi.. Haber si funciona.

nop :/ lo cale en Sv y Cl y nada

Link to comment
Agregaste un evento para activar la funcion?

Intente Asi:

--Barra de Vida 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),function() 
   for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 
    end) 

y Nada :/

Link to comment

Lo Puse asi en Server , esta mal?

--vidabarra 
function barra ( ) 
   for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, barra ) 

Link to comment
Lo Puse asi en Server , esta mal?
--vidabarra 
function barra ( ) 
   for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, barra ) 

si ya lo pusiste por que no lo pruebas ?

Link to comment
Lo Puse asi en Server , esta mal?
--vidabarra 
function barra ( ) 
   for k, myPed in pairs( getElementsByType("slothbot") ) do 
        local px, py, pz = getElementPosition( getLocalPlayer() ) 
        local x, y, z = getPedBonePosition(myPed, 2) 
        if isElementOnScreen( myPed ) and getDistanceBetweenPoints2D(px, py, x, y) < 45 and getElementHealth(myPed) > 0 then 
            local X, Y = getScreenFromWorldPosition( x, y, z ) 
            if X then 
                local arm = getPedArmor( myPed ); 
                local health = getElementHealth( myPed ); 
                local lineLength = 56 * ( health / 100 ); 
                dxDrawRectangle( X - 30, Y - 130, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 128, lineLength, 6, tocolor( 255, 0, 0, 200 ), 6 ); 
                if arm ~= 0 then 
                local lineLengthArm = 56 * ( arm / 100 ); 
                dxDrawRectangle( X - 30, Y - 142, 60, 10, tocolor( 0, 0, 0, 255), 10 ); 
                dxDrawRectangle( X - 28, Y - 140, lineLengthArm, 6, tocolor( 255, 255, 255, 200 ), 6 ); 
                end 
                local BotName = getElementData(myPed, 'BotName'); 
                if not BotName then BotName = 'Zombi' end 
                local namelen = string.len(BotName) 
                dxDrawText( tostring(BotName), X - (3.5 * namelen), Y - 160, X - (3.5 * namelen), Y - 160, tocolor ( 255, 255, 255, 255 ), 1, "default-bold") 
            end 
        end 
    end 
end 
addEventHandler ( "onResourceStart", resourceRoot, barra ) 

si ya lo pusiste por que no lo pruebas ?

Ya lo Probe, quiero saber que estoy haciendp mal porque no funciona

Link to comment
Ese Resource tiene un script llamado 'clientc' , y està configurado para que funcione con los zombies. Y como està codificado no lo puedo ver. Por eso no funciona el sript.

Tambien puedes probar cambiar la parte que dice 'slothbot' por ped.

Y no ahi otro que sirva? o tendria que hacer un scrip desde Cero?

Link to comment
Ese Resource tiene un script llamado 'clientc' , y està configurado para que funcione con los zombies. Y como està codificado no lo puedo ver. Por eso no funciona el sript.

Tambien puedes probar cambiar la parte que dice 'slothbot' por ped.

Y no ahi otro que sirva? o tendria que hacer un scrip desde Cero?

La verdad nose si hay otro. Mejor hacè uno desde 0 a tu gusto! =D

Link to comment
Ese Resource tiene un script llamado 'clientc' , y està configurado para que funcione con los zombies. Y como està codificado no lo puedo ver. Por eso no funciona el sript.

Tambien puedes probar cambiar la parte que dice 'slothbot' por ped.

Y no ahi otro que sirva? o tendria que hacer un scrip desde Cero?

La verdad nose si hay otro. Mejor hacè uno desde 0 a tu gusto! =D

rayos >.<, ok, podrias decirme que ocupo para hacerlo?

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...