Wysłany: 2012-04-19, 16:10
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
witam dzi? chcia?bym sobie zrobi? panel lidera + do tego xml z grupami w acl i na prawa to :
oto kody :
Clinet
Kod: --------------------------------okna
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Window[1] = guiCreateWindow(356,62,406,666,"Panel lidera",false)
guiSetVisible(GUIEditor_Window[1], false)
GUIEditor_Button[1] = guiCreateButton(246,37,137,53,"Dodaj",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(245,129,140,50,"Usun",false,GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(237,549,158,73,"Wyjdz",false,GUIEditor_Window[1])
GUIEditor_Grid[1] = guiCreateGridList(9,16,5,5,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Grid[2] = guiCreateGridList(9,23,203,619,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[2],2)
--------------------------------/okna
--------------------------------funkcej
function show()
if getPlayerTeam(getLocalPlayer()) == team then
local column = guiGridListAddColumn( GUIEditor_Grid[2], "Player", 0.8 )
if ( column ) then
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow (GUIEditor_Grid[2])
guiGridListSetItemText ( GUIEditor_Grid[2], row, column, getPlayerName ( playeritem ), false, false )
end
end
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
end
function wyjdz()
guiSetVisible(GUIEditor_Window[1], false)
showCursor(false)
end
function dodaj()
local pchoose = guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
triggerServerEvent("dodaj", getRootElement(), pchoose, getLocalPlayer())
end
function usun()
local pchoose = guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
triggerServerEvent("usun", getRootElement(), pchoose, getLocalPlayer())
end
--------------------------------/funkcje
------------------------------handlery
addEventHandler( "onClientGUIClick", GUIEditor_Button[3] , wyjdz )
addEventHandler( "onClientGUIClick", GUIEditor_Button[1] , dodaj )
addEventHandler( "onClientGUIClick", GUIEditor_Button[2] , usun )
addCommandHandler("pogop", show)
------------------------------/handlery
Serwer
Kod: addEvent("dodaj", true)
addEventHandler("dodaj", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Doda?e? do Pogotowia login "..accName)
aclGroupAddObject (aclGetGroup("Policja"), "user."..accName)
end)
addEvent("usun", true)
addEventHandler("usun", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Usun??e? z Pogotowia login "..accName)
aclGroupRemoveObject (aclGetGroup("Policja"), "user."..accName)
end)
Ostatnio zmieniony przez luki123luki123 2012-04-19, 17:07, w całości zmieniany 1 raz
Wysłany: 2012-04-19, 16:12
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
Wysłany: 2012-04-19, 16:21
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
wiem ale jaka funkcja idrzie ze odczytuje plik
Wysłany: 2012-04-19, 16:25
Jacob
Głupiomądry
Wiek: 28 Na forum: 5502 dni Posty: 967
Nick w MP: Jacob
Piwa : 786
xmlLoadFile - wczytuje plik
xmlNodeGetAttribute - odczytuje warto?? jak w pliku jest zapisana np. Kod:
xmlNodeGetValue - odczytuje warto?? jak w pliku jest napisane np.
Kod:
Wysłany: 2012-04-19, 17:10
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Serwer
Kod: addEvent("dodaj", true)
addEventHandler("dodaj", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Doda?e? do Pogotowia login "..accName)
aclGroupAddObject (aclGetGroup("Policja"), "user."..accName)
end)
addEvent("usun", true)
addEventHandler("usun", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Usun??e? z Pogotowia login "..accName)
aclGroupRemoveObject (aclGetGroup("Policja"), "user."..accName)
end)
Ej a jak tu doda? na prawa funkcje
[ Dodano : 2012-04-19, 17:12 ]
Kod: <lider acl="LPolicja" acl="policji" >Lider.policj</lider>
Wysłany: 2012-04-20, 14:15
Paweł509
Wiek: 29 Na forum: 5215 dni Posty: 11
No dobry problem o co z tym odczytywaniem chodzi .
ja mam podobny problem i lepszy ?e w tym pliku zrobi? jeszcze na acl i na acl by?o w xml i na grupy
ze jak jeste? liderpoli to mo?esz tylko doda? do policji
Wysłany: 2012-04-22, 20:03
fuNNy!
Wiek: 28 Na forum: 5167 dni Posty: 24
Nick w MP: koxer
Zr?b gui a ci pomoge. Musze mie? przyciski itd.
Wysłany: 2012-04-23, 19:00
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2012-04-23, 20:50
fuNNy!
Wiek: 28 Na forum: 5167 dni Posty: 24
Nick w MP: koxer
Pierwsze co to
outputChatBox("Usun??e? z Pogotowia login "..accName)
zr?b po stronie clienta.
2. Nie radze ci robi? tego panelu bo w?tpie ?e wypali...
Za trudne to nawet dla mnie gdzie bawie si? z lua ju? sporo i ci?gle sie wspinam wy?ej.
Wysłany: 2012-04-23, 20:53
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Dobra jak si? nie znasz to nie pisz bo widz? twoje posty jak ci odpowiadaj? .
A bawisz si? lua du?a w?tpi? .
Pom?? Jacob ,
Wysłany: 2012-04-23, 20:57
fuNNy!
Wiek: 28 Na forum: 5167 dni Posty: 24
Nick w MP: koxer
Zrobi?e? gui i ma?? funkcj?.
Nie licz, ?e kto? pomo?e ci to zrobi?.
Wysłany: 2012-04-30, 09:29
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Zrobi?em TO
Serwer
Kod: addEvent("dodaj", true)
addEventHandler("dodaj", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Doda?e? do Pogotowia login "..accName)
aclGroupAddObject (aclGetGroup("frakcja"), "user."..accName)
end)
addEvent("usun", true)
addEventHandler("usun", getRootElement(),
function(pchoose)
local accName = getAccountName ( getPlayerAccount (getPlayerFromName(pchoose)) )
outputChatBox("Usun??e? z Pogotowia login "..accName)
aclGroupRemoveObject (aclGetGroup("frakcja"), "user."..accName)
end)
function frakcja()
xmlLoadFile ( "lider.xml" )
end
function prawa ()
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("acl")) then
end
end
Clinet
Kod: --------------------------------okna
GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Window[1] = guiCreateWindow(356,62,406,666,"Panel lidera",false)
guiSetVisible(GUIEditor_Window[1], false)
GUIEditor_Button[1] = guiCreateButton(246,37,137,53,"Dodaj",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(245,129,140,50,"Usun",false,GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(237,549,158,73,"Wyjdz",false,GUIEditor_Window[1])
GUIEditor_Grid[1] = guiCreateGridList(9,16,5,5,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Grid[2] = guiCreateGridList(9,23,203,619,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[2],2)
--------------------------------/okna
--------------------------------funkcej
function show()
if getPlayerTeam(getLocalPlayer()) == team then
local column = guiGridListAddColumn( GUIEditor_Grid[2], "Player", 0.8 )
if ( column ) then
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow (GUIEditor_Grid[2])
guiGridListSetItemText ( GUIEditor_Grid[2], row, column, getPlayerName ( playeritem ), false, false )
end
end
guiSetVisible(GUIEditor_Window[1], true)
showCursor(true)
end
end
function wyjdz()
guiSetVisible(GUIEditor_Window[1], false)
showCursor(false)
end
function dodaj()
local pchoose = guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
triggerServerEvent("dodaj", getRootElement(), pchoose, getLocalPlayer())
end
function usun()
local pchoose = guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
triggerServerEvent("usun", getRootElement(), pchoose, getLocalPlayer())
end
--------------------------------/funkcje
------------------------------handlery
addEventHandler( "onClientGUIClick", GUIEditor_Button[3] , wyjdz )
addEventHandler( "onClientGUIClick", GUIEditor_Button[1] , dodaj )
addEventHandler( "onClientGUIClick", GUIEditor_Button[2] , usun )
addCommandHandler("pogop", show)
------------------------------/handlery
Xml
Kod: <1 acl="LPolicja" frakcja="policji" ></1>
[glow=red][shadow=red]
Co z?e
[/shadow][/glow]
Tagi: panel :: lidera
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: