-
Posts
1,004 -
Joined
-
Last visited
Everything posted by Narutimmy
-
entonses... no se puede? que tal si uso setelementheath (creo asi se escribe luego lo busco) y con los If ago que dependiendo el nivel y el arma aga un daño extra?
-
por eso cambie a setPedStat pero no funciona el scrip, llegasa nivel 5 y nada ni el mensaje sale, y no ahi error en el debug
-
-
Bueno... esto fue lo que ise: function propiedades () local level = tonumber ( getElementData ( source, "level" ) ) or 0 if (level == 5) then ---M60--- setPedStat(thePlayer, 77, 50) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 50) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 50) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 50) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 50) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 50) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 50) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 50) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 50) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 10 ) then ---M60--- setPedStat(thePlayer, 77, 100) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 100) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 100) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 100) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 100) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 100) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 100) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 100) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 100) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 15 ) then ---M60--- setPedStat(thePlayer, 77, 150) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 150) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 150) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 150) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 150) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 150) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 150) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 150) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 150) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 20 ) then ---M60--- setPedStat(thePlayer, 77, 200) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 200) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 200) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 200) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 200) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 200) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 200) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 200) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 200) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 25 ) then ---M60--- setPedStat(thePlayer, 77, 250) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 250) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 250) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 250) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 250) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 250) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 250) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 250) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 250) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 30 ) then ---M60--- setPedStat(thePlayer, 77, 300) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 300) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 300) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 300) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 300) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 300) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 300) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 300) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 300) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 35 ) then ---M60--- setPedStat(thePlayer, 77, 350) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 350) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 350) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 350) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 350) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 350) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 350) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 350) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 350) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 40 ) then ---M60--- setPedStat(thePlayer, 77, 400) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 400) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 400) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 400) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 400) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 400) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 400) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun--- setPedStat(thePlayer, 72, 400) outputChatBox("+5 Skills Shotgun", getLocalPlayer(), 0, 255, 0, true) ---UMP--- setPedStat(thePlayer, 76, 400) outputChatBox("+5 Skills UMP", getLocalPlayer(), 0, 255, 0, true) elseif (level == 45 ) then ---M60--- setPedStat(thePlayer, 77, 450) outputChatBox("+5 Skills M60", getLocalPlayer(), 0, 255, 0, true) --AA12--- setPedStat(thePlayer, 74, 450) outputChatBox("+5 Skills AA-12", getLocalPlayer(), 0, 255, 0, true) --Sniper--- setPedStat(thePlayer, 79, 450) outputChatBox("+5 Skills Sniper/Rifle", getLocalPlayer(), 0, 255, 0, true) ---M4--- setPedStat(thePlayer, 78, 450) outputChatBox("+5 Skills Lanzagranadas", getLocalPlayer(), 0, 255, 0, true) ---Silend--- setPedStat(thePlayer, 70, 450) outputChatBox("+5 Skills Silend", getLocalPlayer(), 0, 255, 0, true) ---Pistola--- setPedStat(thePlayer, 69, 450) outputChatBox("+5 Skills Pistola", getLocalPlayer(), 0, 255, 0, true) ---Deagle--- setPedStat(thePlayer, 71, 450) outputChatBox("+5 Skills Deagle", getLocalPlayer(), 0, 255, 0, true) ---Shotgun---
-
Esque aun me confundo con la forma de usar el chat, y sobre el level nop lo obtengo via getElementData de la misma manera que uso para restingir veiculos asi obtengoel nivel actual. pero tengo un problema... como se cuales son las propiedades iniciales de las armas y que cada nivel solo aumente 5 de daño por ejemplo Creo que el arma está en default... lo que pasa es que por ejemplo yo a la silend le pongo: setWeaponProperty ( 23, "pro", "damage", 50 ) pero en lugar de quitarte 50 puntos te quita mas de 100, osea te mata de 1 tiro
-
Esque aun me confundo con la forma de usar el chat, y sobre el level nop lo obtengo via getElementData de la misma manera que uso para restingir veiculos asi obtengoel nivel actual. pero tengo un problema... como se cuales son las propiedades iniciales de las armas y que cada nivel solo aumente 5 de daño por ejemplo
-
Creo seria algo asi... function propiedades () local elev = tonumber ( getElementData ( thePlayer, "level" ) ) or 0 if elev = 1 then setWeaponProperty ( 30, "pro", "damage", 70 ) outputChatBox("Ak-47 +10 Puntos en Skills", getRootElement(), 255, 0, 0, true) elseif elev = 2 then setWeaponProperty ( 30, "pro", "maximum_clip_ammo", 50 ) setWeaponProperty ( 30, "pro", "accuracy", 50 ) outputChatBox("Ak-47 +10 Puntos en Daño", getRootElement(), 255, 0, 0, true) outputChatBox("Ak-47 +10 Puntos en Punteria", getRootElement(), 255, 0, 0, true) end end addEventHandler ( "onPlayerLevelUP", resourceRoot, propiedades ) voy bien?
-
Osea Quieres Que al levelear te aumente ciertos puntos a un arma especifica? Algo asi: as leveado a nivel 2 m4 mejorada en 5 puntos rifle mejorado en 10 mp5 en 6 y asi al nivel 100 que seria el maximo
-
Hola bueno tengo una ligera ideade como podria pero quiero preguntarles... como puedo hacer que al subir de nivel se te agreguen por ejemplo 5 puntos a nose Rifles.... y que tanto daño mas aria un rifle con solo aumentarle 5? me dan una idea o le inicio para yo seguirle... gracias
-
Hola lo que pasa es que quiero saber como funciona? Quiero saber cuanto valor trae por defaul o como se mide? por ejemplo la Deagle la tengo asi function Deagle ( ) setWeaponProperty ( 23, "poor", "damage", 150 ) setWeaponProperty ( 23, "poor", "accuracy", 50 ) setWeaponProperty ( 23, "pro", "damage", 1000 ) setWeaponProperty ( 23, "pro", "accuracy", 100 ) end addEventHandler ( "onResourceStart", resourceRoot, Deagle ) y no quita 150 de vida o 1000 de echo no quita mucho... en cambio la Silend que tiene menos te mata de 1 solo disparo function Silenciadora ( ) setWeaponProperty ( 23, "pro", "damage", 50 ) setWeaponProperty ( 23, "pro", "accuracy", 30 ) end addEventHandler ( "onResourceStart", resourceRoot, Silenciadora ) entonses si por ejemplo yo quiero que la silend quite 50 de vida y la Degle 100... como deberia usarlo?
-
mmm rayos... eso no lo se usar :I Bueno, igual gracias.
-
Me Explicas como usarlo mas no darme el scrip? esque no se me ocurre como usarlo
-
Hola como dice el titulo, como puedo hacer para que solo se pueda crear una cuenta por serial? lo que pasa es que tengo un sistema de puntos que al matar a un user ganan 1 y al morir pierden 1 yl llegar a 0 se borra la cuenta pero lo que hacen es que se crean una cuenta y se dejan matar por un amigo para asi regalarle puntos y viceversa.... lo que quiero es que mientras tengan una cuenta creada no puedan crear otra
-
Bueno creo el error solo era la Ubicacion de la setElementData( slothbot1, "currenthealth", exports.extra_health:getElementExtraHealth( slothbot1 ) ) ya todo bien, el problema es que la barra en lugar de hacerse mas pequeña al bajarle vida el Slotbot.... se ase mas y mas grande
-
La Verdad ya no te entendi nada ... igual gracias por la Ayuda, seguire buscando.
-
if slothbot1 then triggerClientEvent("spawneo", getRootElement()) myBlip = createBlipAttachedTo ( slothbot1, 23 ) setElementData(slothbot1, "Witch", true) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(slothbot1)) local id = getElementModel ( slothbot1 ) en el Server. intente en el client cambiando local currentHealth = exports.extra_health:getElementExtraHealth(slothbot1) y aparece la barra llena pero no disminuye.. eo Slot muere y la barra sigue igual. No Lees lo que digo te dije que pongas el code sin modificar setElementData(slothbot1, "currenthealth", exports.extra_health:getElementExtraHealth(slothbot1)) local currentHealth = getElementData(theWitch, "currenthealth") creo que tendrias que empesar a scriptear El escrip sin modificar es este: sv- function Boss () blip = {} marker = {} local localPed = createPed( 33, -175.610, 57.66, 3.2 ) local health = exports.extra_health:setElementExtraHealth ( localPed, 1000 ) setElementModel ( localPed, 33 ) setPedAnimation(localPed, "ped", "cower", -1, true, true, false) setElementData(localPed, "type", "RealWitch") setPedStat(localPed, 24, 1000) RealWitch = localPed blip[1] = (createBlipAttachedTo ( localPed, 0 )) triggerClientEvent ( "witchsound", root ) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(RealWitch)) setElementData(localPed, "Witch", true) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) cl- local maxDist = 60 function witchNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( theWitch ) local zhx,zhy,zhz = getPedBonePosition(theWitch,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (theWitch, "Witch") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) --local zombieHealth = getElementHealth(theWitch) local maxHP = exports.extra_health:getElementExtraHealth(theWitch) local currentHealth = getElementData(theWitch, "currenthealth") if sxx and getElementHealth(theWitch) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("Witch",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onClientRender", root, witchNameTag) y al mio solo le agregue lo que dijistes pero no funciona, como lo piblique arrivva si funciona pero tira ese error del currenthealth
-
if slothbot1 then triggerClientEvent("spawneo", getRootElement()) myBlip = createBlipAttachedTo ( slothbot1, 23 ) setElementData(slothbot1, "Witch", true) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(slothbot1)) local id = getElementModel ( slothbot1 ) en el Server. intente en el client cambiando local currentHealth = exports.extra_health:getElementExtraHealth(slothbot1) y aparece la barra llena pero no disminuye.. eo Slot muere y la barra sigue igual.
-
me sale este error: EDIT: El problema era que estaba una letra en minusculas pero ahora me sale este error:
-
lo probe y no funciono me tiraba error en el if y esto, ademas del evento tambien if slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z+3, 90, skin, 0, 0, false, weapons [ skin ] or 0, "hunting" ) then triggerClientEvent("spawneo". getRootElement())
-
no te entendi :I
-
Pues ya lo intente pero no, lo que pasa creo es porque mis slotbot no spawnea al iniciar el recurso, sino a un determinado tiempo. Sv: function zona (attacker, weapon, bodypart) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 5 ) then --Numero de Zombis por Matar if ( not isElement ( slothbot1 ) ) then local x, y, z = getElementPosition(attacker) local skin = math.random ( 33, 36 ) slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z+3, 90, skin, 0, 0, false, weapons [ skin ] or 0, "hunting" ) myBlip = createBlipAttachedTo ( slothbot1, 23 ) setElementData(slothbot1, "Witch", true) setElementData(slothbot1, "currenthealth", exports.extra_health:getElementExtraHealth(slothbot1)) local id = getElementModel ( slothbot1 ) if id == 33 then exports.extra_health:setElementExtraHealth(slothbot1, 30000) outputChatBox ( "#ff0000Nemesis: #eeff00S.T.A.R.S!!!", getRootElement(), 255, 255, 255, true) elseif id == 34 then exports.extra_health:setElementExtraHealth(slothbot1, 100000) setElementData(slothbot1, "Witch", true) outputChatBox ( "#ff0000Tyrant a Spawneado, Corre!", getRootElement(), 255, 255, 255, true) elseif id == 35 then exports.extra_health:setElementExtraHealth(slothbot1, 15000) outputChatBox("[bOSS]:Boss low spawned", getRootElement(), 155, 155, 155, false) elseif id == 36 then exports.extra_health:setElementExtraHealth(slothbot1, 400000) outputChatBox("Lincker a Spawneado...", getRootElement(), 155, 155, 155, false) end end end end end addEventHandler ( "onZombieWasted", getRootElement(), zona ) cl: ---- local maxDist = 60 function witchNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( theWitch ) local zhx,zhy,zhz = getPedBonePosition(theWitch,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (theWitch, "Witch") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) --local zombieHealth = getElementHealth(theWitch) local maxHP = exports.extra_health:getElementExtraHealth(theWitch) local currentHealth = getElementData(theWitch, "currenthealth") if sxx and getElementHealth(theWitch) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("Witch",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onClientRender", root, witchNameTag)
-
ya lo intente de diferentes maneras pero no me funciona ... como puedo hacerlo para un slotbot?
-
el codigo lo saque del scrip que subieron de la witch
-
Tengo este codigo que edite para crear una barra de vida encima de un slotbot.. pero nose que pasa que no funciona ---BOSS Vida local maxDist = 60 function BossNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( slothbot1 ) local zhx,zhy,zhz = getPedBonePosition(slothbot1,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (slothbot1, "slothbot1") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) local maxHP = exports.extra_health:getElementExtraHealth(slothbot1) local currentHealth = getElementData(slothbot1, "currenthealth") if sxx and getElementHealth(slothbot1) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("BOSS",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onBotSpawned", root, BossNameTag)
-
Si así estaría mas o menos pero queda mejor así: addEventHandler("onClientPreRender", root, function() x, y, z = getPedBonePosition(getLocalPlayer(), 6) setCameraMatrix(x, y, z, x + x1, y + y1, z + z1) local tarX, tarY, tarZ = getWorldFromScreenPosition(screenWidth/2, screenHeight/2, 30) setPedAimTarget(getLocalPlayer(), tarX, tarY, tarZ) end ) Porque ninguno de los 2 me funciona?
