Wysłany: 2014-06-26, 00:12
zbawca
Wiek: 34 Na forum: 5035 dni Posty: 36
Nick w MP: DJglizdek
Piwa : 1
Witam. Ot?? pr?buje zrobi? skrypt dodaj?cy GUI obok starego freeroam (pr?buje to zrobi? w oddzielnym skrypcie) lecz niestety gdy wciskam F1 pokazuje si? tylko stary panel gracza bez mojego GUI.
Kod wygl?da nast?puj?co:
Client:
GUIEditor = {
button = {},
window = {},
staticimage = {}
}
function fraddon ()
wnd = guiCreateWindow ( 0.01 , 0.49 , 0.32 , 0.21 , "Freeroam dodatek" , true )
guiWindowSetSizable ( wnd , false )
guiSetAlpha ( wnd , 0.90 )
guiSetProperty ( wnd , "CaptionColour" , "FF3CEB13" )
btnhp = guiCreateButton ( 0.02 , 0.13 , 0.95 , 0.12 , "100 % HP" , true , wnd )
local font_0 = guiCreateFont ( ":bhz.ttf" )
guiSetFont ( btnhp , font_0 )
guiSetProperty ( btnhp , "NormalTextColour" , "FF1E8BDF" )
btnarmor = guiCreateButton ( 0.02 , 0.31 , 0.95 , 0.14 , "100% Pancerz" , true , wnd )
guiSetFont ( btnarmor , font_0 )
guiSetProperty ( btnarmor , "NormalTextColour" , "FF1E8BDF" )
lbl = guiCreateLabel ( 0.02 , 0.51 , 0.95 , 0.45 , "Freeroam addon by DJglizdek |Version 1.0|\n\nSkrypt wykonany specjalnie dla\n\n Polski GTA [email protected] \n\n Wszystkie prawa zastrze?one" , true , wnd )
guiSetFont ( lbl , font_0 )
guiLabelSetHorizontalAlign ( lbl , "center" , false )
function dodajzycie ()
triggerServerEvent ( "addhp" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnhp , false )
function dodajpancerz ()
triggerServerEvent ( "addarmour" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnarmor , false )
function zamknij ()
if guiSetVisible ( wnd ) == true then
guiSetVisible ( wnd , true )
end
end
BindKey ( "f1" , down )
end
addEvent ( "FRA" , true )
addEventHandler ( "FRA" , getRootElement (), fraddon )
server:
function addhp ()
setElementStat ( source , 24 , 1000 )
setElementHealth ( source , 200 )
outputChatBox ( "Zosta?e? uleczony!" , source , 0 , 255 , 0 , false )
end
addEvent ( "addhp" , true )
addEventHandler ( "addhp" , getRootElement (), addhp )
function addarmour ()
setPedArmour ( source , 100 )
outputChatBox ( "Otrzyma?e? pancerz!" , source , 0 , 255 , 0 , false )
end
addEvent ( "addarmour" , true )
addEventHandler ( "addarmour" getRootElement (), addarmour
Meta:
Kod: <meta>
<info name="dodatek" type="script" author="djglizdek" version="1.0" />
<script src="addon_c.lua" type="client"></script>
<script src="addon_s.lua" type="server"></script>
<file src="bhz.ttf" />
</meta>
Prosz? pom??cie mi rozwi?za? ten problem dlaczego okienko si? nie pokazuje:c
PS. jest to m?j 2 skrypt
PS 2. Ma on si? otwiera? i zamyka? przyciskiem F1
Z g?ry dzi?kuje za chocia? pr?b? pomocy:)
Wysłany: 2014-06-26, 00:20
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Pomiesza?e? kod wgl.
usu? to function fraddon()
przyk?ad :
okno = guiCreateWindow [...]
bindKey ( "f1", "down", function()
guiSetVisible ( okno, true )
end)
Wysłany: 2014-06-26, 13:44
zbawca
Wiek: 34 Na forum: 5035 dni Posty: 36
Nick w MP: DJglizdek
Piwa : 1
Ok. Usun??em funckje fraddon i teraz ca?y czas wida? GUI od momentu w??czenia skryptu i nie da si? tego zamkn??:\
Wygl?da to teraz nast?puj?co:
GUIEditor = {
button = {},
window = {},
staticimage = {}
}
wnd = guiCreateWindow ( 0.01 , 0.49 , 0.32 , 0.21 , "Freeroam dodatek" , true )
guiWindowSetSizable ( wnd , false )
guiSetAlpha ( wnd , 0.90 )
guiSetProperty ( wnd , "CaptionColour" , "FF3CEB13" )
bindKey ( "f1" , "down" , function()
guiSetVisible ( wnd , true )
end )
btnhp = guiCreateButton ( 0.02 , 0.13 , 0.95 , 0.12 , "100 % HP" , true , wnd )
local font_0 = guiCreateFont ( "bhz.ttf" )
guiSetFont ( btnhp , font_0 )
guiSetProperty ( btnhp , "NormalTextColour" , "FF1E8BDF" )
btnarmor = guiCreateButton ( 0.02 , 0.31 , 0.95 , 0.14 , "100% Pancerz" , true , wnd )
guiSetFont ( btnarmor , font_0 )
guiSetProperty ( btnarmor , "NormalTextColour" , "FF1E8BDF" )
lbl = guiCreateLabel ( 0.02 , 0.51 , 0.95 , 0.45 , "Freeroam addon by DJglizdek |Version 1.0|\n\nSkrypt wykonany specjalnie dla\n\n Polski GTA [email protected] \n\n Wszystkie prawa zastrze?one" , true , wnd )
guiSetFont ( lbl , font_0 )
guiLabelSetHorizontalAlign ( lbl , "center" , false )
function dodajzycie ()
triggerServerEvent ( "addhp" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnhp , dodajzycie , false )
function dodajpancerz ()
triggerServerEvent ( "addarmour" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnarmor , dodajzycie , false )
Okaza?o si? te? ?e przycisk addhp dzia?a idealnie lecz gdy klikam przycisk, addarmor to dzieje si? to samo co z hp czyli dodaje mi ?ycie i zwi?ksza statystyki 1000 ?ycia
tak wygl?da kod
function addhp ()
setPedStat ( source , 24 , 1000 )
setElementHealth ( source , 200 )
outputChatBox ( "Zosta?e? uleczony!" , source , 0 , 255 , 0 , false )
end
addEvent ( "addhp" , true )
addEventHandler ( "addhp" , getRootElement (), addhp )
function addarmour ()
setPedArmor ( source , 100 )
outputChatBox ( "Otrzyma?e? pancerz!" , source , 0 , 255 , 0 , false )
end
addEvent ( "addarmour" , true )
addEventHandler ( "addarmour" , getRootElement (), addarmour )
PS. W debugu nic nie wyskakuje
Wysłany: 2014-06-26, 13:47
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
function dodajzycie ()
triggerServerEvent ( "addhp" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnhp , dodajzycie , false )
function dodajpancerz ()
triggerServerEvent ( "addarmour" , localPlayer )
end
addEventHandler ( "onClientGUIClick" , btnarmor , dodajzycie , false )
Przyjrzyj si? w argumenty na addEventHandler
Co do pokazywania si? gui dodaj po guiCreateWindow to :
guiSetVisible ( wnd , false )
Tagi: dodatek :: freeroam
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: