Xperia Posted December 6, 2012 Posted December 6, 2012 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)
Castillo Posted December 6, 2012 Posted December 6, 2012 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. Education is the most powerful weapon which you can use to change the world.
Castillo Posted December 6, 2012 Posted December 6, 2012 Porque no ocultas el HUD al mostrar el que creaste? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
NodZen Posted December 6, 2012 Posted December 6, 2012 (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 December 6, 2012 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
Castillo Posted December 6, 2012 Posted December 6, 2012 ¿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. Education is the most powerful weapon which you can use to change the world.
NodZen Posted December 6, 2012 Posted December 6, 2012 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
NodZen Posted December 6, 2012 Posted December 6, 2012 Probalo con "onResourceStart" , ya que "onPlayerJoin" es server-side. ------------------------------------------------------------------------------------------ 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
Xperia Posted December 6, 2012 Author Posted December 6, 2012 Tampoco. PD: Tambien probe "onClientResourceStart".
NodZen Posted December 6, 2012 Posted December 6, 2012 Tampoco. Probalo en un script nuevo , con "onPlayerJoin" y en server-side. ------------------------------------------------------------------------------------------ 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
Castillo Posted December 6, 2012 Posted December 6, 2012 @Xperia: Probaste con lo que yo te dije? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
NodZen Posted December 6, 2012 Posted December 6, 2012 Pues , entonces nosé. Yo tengo tambien mi hud y con eso anda bien. ------------------------------------------------------------------------------------------ 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
Xperia Posted December 6, 2012 Author Posted December 6, 2012 Pues , entonces nosé. Yo tengo tambien mi hud y con eso anda bien. ¿En server-side?
NodZen Posted December 6, 2012 Posted December 6, 2012 Pues , entonces nosé. Yo tengo tambien mi hud y con eso anda bien. ¿En server-side? Client. ------------------------------------------------------------------------------------------ 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
Castillo Posted December 6, 2012 Posted December 6, 2012 Tampoco. PD: Si Solid. Postea tu HUD. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Xperia Posted December 6, 2012 Author Posted December 6, 2012 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.
NodZen Posted December 6, 2012 Posted December 6, 2012 Si usas el spawn de 50p , editaste el "c_main" para que no aparescan los elementos?. ------------------------------------------------------------------------------------------ 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
Xperia Posted December 6, 2012 Author Posted December 6, 2012 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.
Castillo Posted December 6, 2012 Posted December 6, 2012 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. Education is the most powerful weapon which you can use to change the world.
NodZen Posted December 6, 2012 Posted December 6, 2012 Estoy para eso! ( dentro de lo que sepa ) . ------------------------------------------------------------------------------------------ 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
BorderLine Posted December 7, 2012 Posted December 7, 2012 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
Recommended Posts