function open5(thePlayer)
local xml = xmlLoadFile ( "config/lider.xml")
if xml then
for k,v in ipairs (xmlFindChild(xml,"teamy",0)) do
local aaa = xmlNodeGetChildren(xmlFindChild(v,"lider2",0))
local args = xmlNodeGetAttributes(aaa)
accountname = getAccountName ( getPlayerAccount( thePlayer ) )
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( args.lider ) ) then
triggerClientEvent(thePlayer,"pokaz5", getRootElement())
end
end
end
end
addCommandHandler("lider", open5)
function open5(thePlayer)
local xml = xmlLoadFile ( "config/lider.xml")
if xml then
local file = xmlFindChild (xml,"teamy",0)
for i,v in ipairs (xmlNodeGetChildren(file)) do
local args = xmlNodeGetAttribute (v,"lider2")
accountname = getAccountName (getPlayerAccount( thePlayer))
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup (args)) then
triggerClientEvent(thePlayer,"pokaz5", getRootElement())
end
end
end
end
addCommandHandler("lider", open5)
Teraz mam kilka problem?w :
a)tworzenie Rang:
Client:
--Rangi
local xml = xmlLoadFile ( "config/lider.xml")
if xml then
local teamy = xmlFindChild (xml,"stopnie",0)
local file = xmlFindChild (teamy,"team",0)
for i,b in ipairs (xmlNodeGetChildren(file)) do
local args = xmlNodeGetAttribute (b,"acl")
local kolor1 = xmlNodeGetAttribute (b,"r")
local kolor2 = xmlNodeGetAttribute (b,"g")
local kolor3 = xmlNodeGetAttribute (b,"b")
local val = xmlNodeGetValue(file)
local rw = guiGridListAddRow ( lider_Grid[1] )
guiGridListSetItemText (lider_Grid[1], rw, kolumna2, val, false, false )
guiGridListSetItemColor (lider_Grid[1], rw, 1, kolor1,kolor2,kolor3,255 )
--Koniec rang
b)Dodawanie osoby:
Dodaje do ka?dej frakcji :
Serwer:
function Dodaj5(gracz)
local gracz1 = getPlayerFromName( gracz )
local xml = xmlLoadFile ( "config/lider.xml")
if xml then
if gracz1 then
local file = xmlFindChild (xml,"teamy",0)
for i,v in ipairs (xmlNodeGetChildren(file)) do
local args = xmlNodeGetAttribute (v,"acl")
local aclGroup = aclGetGroup( args )
local accName = getAccountName(getPlayerAccount ( getPlayerFromName( gracz ) ))
aclGroupAddObject(aclGroup, "user."..accName)
outputChatBox("#00ffaaDoda?e? gracza o nicku "..gracz.." #00ffaado "..args.."", getRootElement(), 255, 255, 255, true)
outputChatBox("#00ffaaZosta?e? dodany do "..args..".", gracz1, 255, 255, 255, true)
end
end
end
end
addEvent("dodaj5", true)
addEventHandler("dodaj5", getRootElement(), Dodaj5)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach