Narutimmy Posted November 5, 2012 Share Posted November 5, 2012 (edited) Hola buenas, navegando en la comunidad me tope con este scrip https://community.multitheftauto.com/ind ... w&pic=5388 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 Edited November 9, 2012 by Guest Link to comment
NodZen Posted November 5, 2012 Share Posted November 5, 2012 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
Narutimmy Posted November 6, 2012 Author Share Posted November 6, 2012 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
NodZen Posted November 6, 2012 Share Posted November 6, 2012 Agregaste un evento para activar la funcion? Link to comment
Narutimmy Posted November 8, 2012 Author Share Posted November 8, 2012 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
Narutimmy Posted November 9, 2012 Author Share Posted November 9, 2012 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
Arsilex Posted November 9, 2012 Share Posted November 9, 2012 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
Narutimmy Posted November 9, 2012 Author Share Posted November 9, 2012 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
NodZen Posted November 9, 2012 Share Posted November 9, 2012 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. Link to comment
Narutimmy Posted November 9, 2012 Author Share Posted November 9, 2012 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
NodZen Posted November 9, 2012 Share Posted November 9, 2012 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
Narutimmy Posted November 9, 2012 Author Share Posted November 9, 2012 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
NodZen Posted November 9, 2012 Share Posted November 9, 2012 rayos >.<, ok, podrias decirme que ocupo para hacerlo? getElementsByType getElementPosition , getLocalPlayer getPedArmor getElementHealth dxDrawRectangle Creo que me falta una mas. Pero no me acuerdo. Link to comment
Recommended Posts