Jump to content

Hud


Xperia

Recommended Posts

Posted

Tengo un hud hecho, y en ese script, en client side, quiero quitarlo, pero al reconectar, el hud vuelve.¿Que le hago?

function quitar() 
    showPlayerHudComponent ( "armour", false ) 
    showPlayerHudComponent ( "health", false ) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "clock", false ) 
    showPlayerHudComponent ( "weapon", false ) 
    showPlayerHudComponent ( "ammo", false) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "wanted", false ) 
    showPlayerHudComponent ( "radar", true ) 
end  
addEventHandler("onClientResourceStart",getRootElement(),quitar) 

430x73.png

430x73.png

Posted
function quitar ( ) 
    showPlayerHudComponent ( "armour", false ) 
    showPlayerHudComponent ( "health", false ) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "clock", false ) 
    showPlayerHudComponent ( "weapon", false ) 
    showPlayerHudComponent ( "ammo", false) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "wanted", false ) 
    showPlayerHudComponent ( "radar", true ) 
end  
addEventHandler ( "onClientPlayerSpawn", localPlayer, quitar ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Porque no ocultas el HUD al mostrar el que creaste?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (edited)

Probalo asi de nuevo.

function quitar ( ) 
    showPlayerHudComponent (source, "armour", false ) 
    showPlayerHudComponent (source, "health", false ) 
    showPlayerHudComponent (source, "money", false ) 
    showPlayerHudComponent (source, "clock", false ) 
    showPlayerHudComponent (source, "weapon", false ) 
    showPlayerHudComponent (source, "ammo", false) 
    showPlayerHudComponent (source, "money", false ) 
    showPlayerHudComponent (source, "wanted", false ) 
    showPlayerHudComponent (source, "radar", true ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), quitar ) 

Edited by Guest

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted
¿Que lo haga en otro script?

Al mostrar el HUD que vos creaste, ahi ocultas el de GTA.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Probalo asi de nuevo.
function quitar ( ) 
    showPlayerHudComponent (source, "armour", false ) 
    showPlayerHudComponent (source, "health", false ) 
    showPlayerHudComponent (source, "money", false ) 
    showPlayerHudComponent (source, "clock", false ) 
    showPlayerHudComponent (source, "weapon", false ) 
    showPlayerHudComponent (source, "ammo", false) 
    showPlayerHudComponent (source, "money", false ) 
    showPlayerHudComponent (source, "wanted", false ) 
    showPlayerHudComponent (source, "radar", true ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), quitar ) 

Probalo asi ahora.

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

@Xperia: Probaste con lo que yo te dije?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Tampoco.

PD: Si Solid.

Postea tu HUD.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function speed ( ) 
    addEventHandler ( "onClientRender", root, getspeed ) 
end 
addEventHandler ("onClientVehicleEnter", root, speed) 
  
function wylacz ( ) 
  
    removeEventHandler ( "onClientRender", root, getspeed ) 
end 
addEventHandler("onClientVehicleExit", root, wylacz) 
  
  
addEventHandler("onClientRender",getRootElement(), 
    function ( ) 
        weaponID = getPedWeapon(getLocalPlayer()) 
        weapName = getWeaponNameFromID(weaponID) 
        health = getElementHealth (localPlayer) 
        dxDrawText("Player Health: "..tostring(math.floor(health+0.5)).." %",20.0,264.0,296.0,280.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Weapon Name: "..weapName,20.0,285.0,296.0,301.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        if isPedInVehicle (localPlayer) == false then return end 
        Vname = getVehicleName(getPedOccupiedVehicle(localPlayer)) 
        health = getElementHealth (getPedOccupiedVehicle(localPlayer)) 
        sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) 
        kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) 
        dxDrawText("Vehicle Name: "..Vname,20.0,307.0,296.0,323.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Vehicle Health: "..tostring(math.floor(health*0.1)).." %",20.0,328.0,296.0,344.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Speed: "..tostring(kmhs).." Km/h",20.0,348.0,296.0,364.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
    end 
) 
  
function quitar ( ) 
    showPlayerHudComponent ( "armour", false ) 
    showPlayerHudComponent ( "health", false ) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "clock", false ) 
    showPlayerHudComponent ( "weapon", false ) 
    showPlayerHudComponent ( "ammo", false) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "wanted", false ) 
    showPlayerHudComponent ( "radar", true ) 
end 
addEventHandler ( "onClientPlayerSpawn", localPlayer, quitar ) 

EDIT: Uso el spawn de 50p.

430x73.png

430x73.png

Posted
Si usas el spawn de 50p , editaste el "c_main" para que no aparescan los elementos?.

Este post fue un poco "fail", al parecer lo tenia bien, pense que el spawn de 50p afectaba pero me entro en una oreja y me salio por otra.Igualmente, ya me funciona, gracias Solid y NOD.

430x73.png

430x73.png

Posted
function speed ( ) 
    addEventHandler ( "onClientRender", root, getspeed ) 
end 
addEventHandler ("onClientVehicleEnter", root, speed) 
  
function wylacz ( ) 
  
    removeEventHandler ( "onClientRender", root, getspeed ) 
end 
addEventHandler("onClientVehicleExit", root, wylacz) 
  
addEventHandler("onClientRender",getRootElement(), 
    function ( ) 
        weaponID = getPedWeapon(getLocalPlayer()) 
        weapName = getWeaponNameFromID(weaponID) 
        health = getElementHealth (localPlayer) 
        dxDrawText("Player Health: "..tostring(math.floor(health+0.5)).." %",20.0,264.0,296.0,280.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Weapon Name: "..weapName,20.0,285.0,296.0,301.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        if isPedInVehicle (localPlayer) == false then return end 
        Vname = getVehicleName(getPedOccupiedVehicle(localPlayer)) 
        health = getElementHealth (getPedOccupiedVehicle(localPlayer)) 
        sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) 
        kmhs = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) 
        dxDrawText("Vehicle Name: "..Vname,20.0,307.0,296.0,323.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Vehicle Health: "..tostring(math.floor(health*0.1)).." %",20.0,328.0,296.0,344.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
        dxDrawText("Speed: "..tostring(kmhs).." Km/h",20.0,348.0,296.0,364.0,tocolor(0,255,0,255),0.5,"bankgothic","left","top",false,false,false) 
    end 
) 
  
function quitar ( ) 
    setTimer ( 
        function ( ) 
            for _, component in ipairs ( { "armour", "health", "money", "clock", "weapon", "ammo", "money", "wanted", "radar" } ) do 
                showPlayerHudComponent ( component, false ) 
            end 
        end 
        ,5000, 1 
    ) 
end 
addEventHandler ( "onClientPlayerSpawn", localPlayer, quitar ) 

Lo ocultara 5 segundos despues de spawnear.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function quitar() 
    showPlayerHudComponent ( "armour", false ) 
    showPlayerHudComponent ( "health", false ) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "clock", false ) 
    showPlayerHudComponent ( "weapon", false ) 
    showPlayerHudComponent ( "ammo", false) 
    showPlayerHudComponent ( "money", false ) 
    showPlayerHudComponent ( "wanted", false ) 
    showPlayerHudComponent ( "radar", true ) 
end  
addEventHandler("onClientPlayerJoin",getLocalPlayer(),quitar) 
addEventHandler("onClientPlayerWasted",getLocalPlayer(),quitar) 
addEventHandler("onClientPlayerSpawn",getLocalPlayer(),quitar) 

intenta eso y cuando reinicies script matate..

Deberia funcionar

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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