Wysłany: 2014-08-09, 15:39
Mizy1999
I <3 Mta
Wiek: 28 Na forum: 4995 dni Posty: 157
Nick w MP: xxx
Piwa : 154
Okej, jednak podam ca?y kod tego panelu. Nie jest on trudny do wykonania wi?c... ;d
Tylko mam problem, taki jak wcze?niej wywala: Bad argument, na linijce o tej:
Kod: addEventHandler ( "onClientGUIClick", podnosnikupbutton,
function()
outputChatBox ( "[Panel] Podno?nik aktywowany!", 0, 150, 0 )
triggerServerEvent ( "podnosnikup", getLocalPlayer() )
end
)
Tak dok?adnie to na wszystkich kt?re odnosz? si? do button?w. Nie wiem czemu, pr?bowa?em jak tutaj up wida?, zmieni? zmienn? Gui.Button[1] Czy jak ona tam mia?a na podnosnikupbutton i tak samo.
C-side:
Kod: GUIEditor = {
button = {},
window = {},
label = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(949, 296, 245, 443, "Panel Mechanika", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF528B0F")
podnosnikupbutton = guiCreateButton(16, 135, 88, 42, "Podno?nik: Up", false, GUIEditor.window[1])
guiSetFont(podnosnikupbutton, "default-bold-small")
guiSetProperty(podnosnikupbutton, "NormalTextColour", "FF528B0F")
GUIEditor.button[2] = guiCreateButton(138, 134, 88, 43, "Podno?nik: Down", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[2], "default-bold-small")
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF528B0F")
GUIEditor.button[3] = guiCreateButton(17, 270, 87, 50, "", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(17, 270, 87, 50, "Skin: Mechanik Kobieta I", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[4], "default-bold-small")
guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF943405")
GUIEditor.button[5] = guiCreateButton(143, 270, 83, 50, "Skin: Mechanik Kobieta II", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[5], "default-bold-small")
guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FF943405")
GUIEditor.button[6] = guiCreateButton(17, 330, 87, 54, "Skin: Mechanik M??czyzna I", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[6], "default-bold-small")
guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FF943405")
GUIEditor.button[7] = guiCreateButton(143, 330, 83, 54, "Skin: Mechanik M??czyzna II", false, GUIEditor.window[1])
guiSetFont(GUIEditor.button[7], "default-bold-small")
guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FF943405")
GUIEditor.label[1] = guiCreateLabel(23, 57, 217, 48, "Tutaj mo?esz zmieni? skin, wraz z ", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
GUIEditor.label[2] = guiCreateLabel(23, 70, 219, 25, "interakcj? podno?nika.", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[2], "default-bold-small")
end
)
-- Otwieranie Gui po przez "u"
bindKey ( "u", "down", function()
triggerServerEvent ( "open", getLocalPlayer() )
end)
addEvent ( "otworz", true )
addEventHandler ( "otworz", root, function()
if source ~= getLocalPlayer() then return end
if guiGetVisible ( GUIEditor.window[1] ) == false then
guiSetVisible ( GUIEditor.window[1], true )
showCursor ( true )
for k,v in pairs ( getElementsByType ( "player" )) do
if getElementData ( v, "Fcmc" ) == true then
end
end
else
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
end
end)
-- Zmiana skin?w, trigger'owanie do Clienta
addEventHandler ( "onClientGUIClick", podnosnikupbutton,
function()
outputChatBox ( "[Panel] Podno?nik aktywowany!", 0, 150, 0 )
triggerServerEvent ( "podnosnikup", getLocalPlayer() )
end
)
--[[
addEventHandler ( "onClientGUIClick", GUIEditor.button[2],
function()
outputChatBox ( "[Panel] Podno?nik Desaktywowany!", 0, 150, 0 )
triggerServerEvent ( "podnosnikdown", getLocalPlayer() )
end
)
addEventHandler ( "onClientGUIClick", GUIEditor.button[4], function()
outputChatBox ( "[Panel] Zmieniono skin na: Mechanik Kobieta I", 0, 160, 0 )
setElementModel ( localPlayer, 179 )
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
end, false )
addEventHandler ( "onClientGUIClick", GUIEditor.button[5], function(thePlayer)
outputChatBox ( "[Panel] Ta opcja oczekuje oskryptowania, masz pomys? na ni? ? Napisz na Forum!", 0, 160, 0 )
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
end, false)
addEventHandler ( "onClientGUIClick", GUIEditor.button[6], function(thePlayer)
outputChatBox ( "[Panel] Zmieniono skin na: Mechanik M??czyzna I", 0, 160, 0 )
setElementModel ( localPlayer, 190 )
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
end, false)
addEventHandler ( "onClientGUIClick", GUIEditor.button[7], function(thePlayer)
outputChatBox ( "[Panel] Ta opcja oczekuje oskryptowania, masz pomys? na ni? ? Napisz na Forum!", 0, 160, 0 )
end, false)
]]--
-- Zamykanie okna dla klieta z triggera serwer
addEvent ( "zamknij", true )
addEventHandler ( "zamknij", root, function()
if source ~= getLocalPlayer() then return end
if guiGetVisible ( GUIEditor.window[1] ) == true then
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
end
end)
S-side:
Kod:
addEvent ( "open", true )
addEventHandler ( "open", root, function()
local accName = getAccountName ( getPlayerAccount ( source ) )
if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Fcmc" ) ) then
outputChatBox ( "", source, 80, 200, 0 ) return end
triggerClientEvent ( "otworz", source )
end)
podnosnik1down = createObject( 2567, -304.5, 1018.0996, 16.8, 0, 0, 0)
podnosnik2down = createObject( 2567, -304.5, 1021.5996, 16.8, 0, 0, 0)
addEvent ( "podnosnikup", true )
addEventHandler ( "podnosnikup", root, function()
moveObject ( podnosnik1down, 10000,-304.5, 1018.0996, 18)
moveObject ( podnosnik2down, 10000,-304.5, 1021.5996, 18)
triggerClientEvent ( "zamknij", source )
end)
addEvent ( "podnosnikdown", true )
addEventHandler ( "podnosnikdown", root, function()
moveObject ( podnosnik1down, -304.5, 1018.0996, 16.8)
moveObject ( podnosnik2down, -304.5, 1021.5996, 16.8)
triggerClientEvent ( "zamknij", source )
end)
[/code]
Wysłany: 2014-08-09, 15:46
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wywala Ci b??dy bo po co Ci onClientResourceStart przy tworzeniu gui ?
Kawa?ek c-side
GUIEditor = {
button = {},
window = {},
label = {}
}
GUIEditor . window [ 1 ] = guiCreateWindow ( 949 , 296 , 245 , 443 , "Panel Mechanika" , false )
guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
guiSetProperty ( GUIEditor . window [ 1 ], "CaptionColour" , "FF528B0F" )
podnosnikupbutton = guiCreateButton ( 16 , 135 , 88 , 42 , "Podno?nik: Up" , false , GUIEditor . window [ 1 ])
guiSetFont ( podnosnikupbutton , "default-bold-small" )
guiSetProperty ( podnosnikupbutton , "NormalTextColour" , "FF528B0F" )
GUIEditor . button [ 2 ] = guiCreateButton ( 138 , 134 , 88 , 43 , "Podno?nik: Down" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 2 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 2 ], "NormalTextColour" , "FF528B0F" )
GUIEditor . button [ 3 ] = guiCreateButton ( 17 , 270 , 87 , 50 , "" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 4 ] = guiCreateButton ( 17 , 270 , 87 , 50 , "Skin: Mechanik Kobieta I" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 4 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 4 ], "NormalTextColour" , "FF943405" )
GUIEditor . button [ 5 ] = guiCreateButton ( 143 , 270 , 83 , 50 , "Skin: Mechanik Kobieta II" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 5 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 5 ], "NormalTextColour" , "FF943405" )
GUIEditor . button [ 6 ] = guiCreateButton ( 17 , 330 , 87 , 54 , "Skin: Mechanik M??czyzna I" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 6 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 6 ], "NormalTextColour" , "FF943405" )
GUIEditor . button [ 7 ] = guiCreateButton ( 143 , 330 , 83 , 54 , "Skin: Mechanik M??czyzna II" , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . button [ 7 ], "default-bold-small" )
guiSetProperty ( GUIEditor . button [ 7 ], "NormalTextColour" , "FF943405" )
GUIEditor . label [ 1 ] = guiCreateLabel ( 23 , 57 , 217 , 48 , "Tutaj mo?esz zmieni? skin, wraz z " , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 1 ], "default-bold-small" )
GUIEditor . label [ 2 ] = guiCreateLabel ( 23 , 70 , 219 , 25 , "interakcj? podno?nika." , false , GUIEditor . window [ 1 ])
guiSetFont ( GUIEditor . label [ 2 ], "default-bold-small" )
Tagi: panel :: mechanika :: reflesh.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: