Wysłany: 2018-02-08, 17:37
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
Siema, mam problem ze zrobieniem gui aktualnej broni.
Chodzi o to, ?e pojawia mi si? pi???, ale po zmianie broni nic si? nie zmienia - dalej ona jest.
Z g?ry dzi?ki, za pomoc stawiam piwo.
Kod:
setPlayerHudComponentVisible ( "ammo" , false )
setPlayerHudComponentVisible ( "armour" , false )
setPlayerHudComponentVisible ( "clock" , false )
setPlayerHudComponentVisible ( "health" , false )
setPlayerHudComponentVisible ( "money" , false )
setPlayerHudComponentVisible ( "vehicle_name" , false )
setPlayerHudComponentVisible ( "weapon" , false )
bindKey ( "f11" , "down" , function()
if map == true then
map = false
setElementData ( localPlayer , "hud:enabled" , true )
showChat ( true )
showPlayerHudComponent ( "all" , false )
showPlayerHudComponent ( "radar" , true )
showPlayerHudComponent ( "crosshair" , true )
else
map = true
setElementData ( localPlayer , "hud:enabled" , false )
showChat ( false )
showPlayerHudComponent ( "all" , false )
end
end )
local czciona = dxCreateFont ( "font.ttf" , 20 )
local weapon = getPedWeapon ( localPlayer )
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize () -- pobieramy rozdzielczo ?? gracza kt ? ry widzi gui
local px , py = ( sx / 1366 ),( sy / 768 ) -- dzielimy rozdzielczo ?? gracza kt ? ry widzi gui przez rozdzielczo ?? na kt ? rej by ? o robione gui .
local patch = "hud/" .. weapon .. ".png"
addEventHandler ( "onClientRender" , root ,
function()
if getElementData ( localPlayer , "hud:enabled" ) == false then return end
--[[
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , ":mr-hud/hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( getPlayerMoney ( localPlayer ), screenW * 0.03 , screenH * 0.9676 , screenW * 0.1031 , screenH * 0.9944 , tocolor ( 255 , 255 , 255 , 255 ), 0.80 , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( string . format ( "%.0f" , getElementHealth ( localPlayer )), screenW * 0.1411 , screenH * 0.9657 , screenW * 0.1922 , screenH * 0.9944 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( getElementData ( localPlayer , "player:reputation" ), screenW * 0.2099 , screenH * 0.9639 , screenW * 0.2865 , screenH * 0.9907 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , czciona , "left" , "top" , false , false , false , false , false )
--]]
dxDrawImage ( 0 * px , 0 * py , 1366 * px , 768 * py , ":MR-hud/hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( getPlayerMoney ( localPlayer ), 42 * px , 743 * py , 127 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( string . format ( "%.0f" , getElementHealth ( localPlayer )), 200 * px , 742 * py , 232 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( getElementData ( localPlayer , "player:reputation" ), 291 * px , 742 * py , 358 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
if fileExists ( patch ) then
dxDrawImage ( 1278 * px , 668 * py , 78 * px , 65 * py , patch , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
end
)
Wysłany: 2018-02-08, 17:55
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
setPlayerHudComponentVisible ( "ammo" , false )
setPlayerHudComponentVisible ( "armour" , false )
setPlayerHudComponentVisible ( "clock" , false )
setPlayerHudComponentVisible ( "health" , false )
setPlayerHudComponentVisible ( "money" , false )
setPlayerHudComponentVisible ( "vehicle_name" , false )
setPlayerHudComponentVisible ( "weapon" , false )
bindKey ( "f11" , "down" , function()
if map == true then
map = false
setElementData ( localPlayer , "hud:enabled" , true )
showChat ( true )
showPlayerHudComponent ( "all" , false )
showPlayerHudComponent ( "radar" , true )
showPlayerHudComponent ( "crosshair" , true )
else
map = true
setElementData ( localPlayer , "hud:enabled" , false )
showChat ( false )
showPlayerHudComponent ( "all" , false )
end
end )
local czciona = dxCreateFont ( "font.ttf" , 20 )
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize () -- pobieramy rozdzielczo ?? gracza kt ? ry widzi gui
local px , py = ( sx / 1366 ),( sy / 768 ) -- dzielimy rozdzielczo ?? gracza kt ? ry widzi gui przez rozdzielczo ?? na kt ? rej by ? o robione gui .
addEventHandler ( "onClientRender" , root ,
function()
if getElementData ( localPlayer , "hud:enabled" ) == false then return end
--[[
dxDrawImage ( screenW * 0.0000 , screenH * 0.0000 , screenW * 1.0000 , screenH * 1.0000 , ":mr-hud/hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( getPlayerMoney ( localPlayer ), screenW * 0.03 , screenH * 0.9676 , screenW * 0.1031 , screenH * 0.9944 , tocolor ( 255 , 255 , 255 , 255 ), 0.80 , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( string . format ( "%.0f" , getElementHealth ( localPlayer )), screenW * 0.1411 , screenH * 0.9657 , screenW * 0.1922 , screenH * 0.9944 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( getElementData ( localPlayer , "player:reputation" ), screenW * 0.2099 , screenH * 0.9639 , screenW * 0.2865 , screenH * 0.9907 , tocolor ( 255 , 255 , 255 , 255 ), 1.00 , czciona , "left" , "top" , false , false , false , false , false )
--]]
dxDrawImage ( 0 * px , 0 * py , 1366 * px , 768 * py , ":MR-hud/hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
dxDrawText ( getPlayerMoney ( localPlayer ), 42 * px , 743 * py , 127 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( string . format ( "%.0f" , getElementHealth ( localPlayer )), 200 * px , 742 * py , 232 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
dxDrawText ( getElementData ( localPlayer , "player:reputation" ), 291 * px , 742 * py , 358 * px , 758 * py , tocolor ( 255 , 255 , 255 , 255 ), 0.6 * px , czciona , "left" , "top" , false , false , false , false , false )
dxDrawImage ( 1278 * px , 668 * py , 78 * px , 65 * py , "hud/" .. tostring ( getPedWeapon ( localPlayer )).. ".png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
end
)
Więcej szczegółów
Wystawiono 1 piw(a):Kuksss
Wysłany: 2018-02-08, 18:15
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
NyAngel , Niestety, ale to nie dzia?a
Wysłany: 2018-02-08, 18:20
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
Jaki? b??d? i jak masz to wrzucone te png.
chodzi mi czy jest to zrobione tak : FOLEDER>FOLDER 2 > png czy
FOLDER > PLIKI
Wysłany: 2018-02-08, 18:28
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
NyAngel , B??d?w nie ma, wszucone mam to tak:
MR-HUD(folder ze skryptami)>hud(i tutaj wszystkie png)
Wysłany: 2018-02-08, 18:30
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
Specjalnie dla ciebie sprawdzi?em to i u mnie dzia?a kod ten co ja Ci poda?em.(wrzucilem jakie? grafiki i dzia?a,zrobi?em tak samo jaki da?em tobie kod)
local sx , sy = guiGetScreenSize ()
local px , py = ( sx / 1366 ),( sy / 768 )
addEventHandler ( "onClientRender" , root ,function()
dxDrawImage ( 1278 * px , 668 * py , 78 * px , 65 * py , "hud/" .. tostring ( getPedWeapon ( localPlayer )).. ".png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end )
Więcej szczegółów
Wystawiono 1 piw(a):Kuksss
Wysłany: 2018-02-08, 18:35
Kuksss
guwno
Wiek: 22 Na forum: 3781 dni Posty: 102
Nick w MP: guwnp
Piwa : 732
NyAngel , O ja pier.. ale ze mnie debil, nie usun??em endu z if'a xd
Dobra, masz piwo i dzi?ki za pomoc
Tagi: zmiana :: broni :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: