Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-03-20, 12:08


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Robi? teraz panel lidera i nie chce si? w??czy? panel !! kod

XML

<xml>
< Lider = "LPogo" frakcja = "Pogo"  />
</xml> 

Serwer:

function open5(thePlayer, team)
   local xml = xmlLoadFile ( "lide.xml" )
   local team = xmlFindChild ( xml, "Lider", 0 )
   local success = xmlNodeGetValue ( team )
   accountname = getAccountName ( getPlayerAccount( thePlayer ) )
    if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "success" ) ) then
        triggerClientEvent(thePlayer,"pokaz5", getRootElement())
    end
end
addCommandHandler("lider", open5)

Clinet:

function Pokaz5()
        if (guiGetVisible(lider_Window[1]) == false) then
            showCursor(true)
            guiSetVisible(lider_Window[1], true)
            if (kolumna) then
                for id, player in ipairs(getElementsByType("player")) do
                    local row = guiGridListAddRow(lider_Grid[1])
                    guiGridListSetItemText(lider_Grid[1], row, kolumna, getPlayerName(player), false, false)
                end
            end
        else
            guiSetVisible(lider_Window[1], false)
            showCursor(false)
            guiGridListClear(lider_Grid[1])
        end
    end
addEvent("pokaz5", true)
addEventHandler("pokaz5", getRootElement(), Pokaz5)


Ostatnio zmieniony przez luki123luki123 2013-03-24, 14:34, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-20, 13:48


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

W debugu jakie? b??dy?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-20, 14:07


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

no odno?nie xmlNodeGetValue

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-20, 16:34


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Podaj ten b??d. Spr?buj te? usun?? argument z funkcji o nazwie "team".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-23, 19:40


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

B??d ipairs .


Serwer:
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)



XML:

<root>
    <teamy>
       <lider acl="Policja" baza="Policja" lider2="policji" r="0" g="0" b="255">Policja</lider>
       <lider acl="Pomoc Drogowa" baza="PomocDrogowa" lider2="pd" r="255" g="0" b="255">Pomoc Drogowa</lider>
       <lider acl="Pogotowie" baza="Pogotowie" lider2="pogotowia" r="61" g="182" b="200">Pogotowie</lider>
       <lider acl="Taxi" baza="Taxi" lider2="taxi" r="255" g="255" b="0">Taxi</lider>
       <lider acl="Salon" baza="Salon" lider2="salonu" r="0" g="255" b="0">Salon</lider>
       <lider acl="Ammo" baza="bronie" lider2="ammo" r="100" g="100" b="100">Ammunation</lider>
       <lider acl="Petrol" baza="Petrol" lider2="petrolu" r="255" g="102" b="51">Petrol</lider>
    </teamy>
</root>

HELP

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-23, 19:52


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Sprawd? tak:

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-25, 17:47


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

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

tworzy tylko 1 range
XML:
    <stopnie>
        <team>
            <stopien kasa="5000" liderpp="policji" r="0" g="0" b="255" >Wojskowy</stopien>
            <stopien kasa="5000" liderpp="policji" r="0" g="0" b="255" >Policjant</stopien>
            <stopien kasa="5000" liderpp="policji" r="0" g="0" b="255" >Policjant2</stopien>
            <stopien kasa="5000" liderpp="policji" r="0" g="0" b="255" >Policjant3</stopien>
            <stopien kasa="5000" liderpp="policji" r="0" g="0" b="255" >Policjant4</stopien>
        </team>
    </stopnie>

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)

XML:
    <teamy>
       <lider acl="Policja" baza="Policja" lider2="policji" r="0" g="0" b="255" b="b="255" "  >Policja</lider>
       <lider acl="Pomoc Drogowa" baza="PomocDrogowa" lider2="pd" r="255" g="0" b="255">Pomoc Drogowa</lider>
       <lider acl="Pogotowie" baza="Pogotowie" lider2="pogotowia" r="61" g="182" b="200">Pogotowie</lider>
       <lider acl="Taxi" baza="Taxi" lider2="taxi" r="255" g="255" b="0">Taxi</lider>
       <lider acl="Salon" baza="Salon" lider2="salonu" r="0" g="255" b="0">Salon</lider>
       <lider acl="Ammo" baza="bronie" lider2="ammo" r="100" g="100" b="100">Ammunation</lider>
       <lider acl="Petrol" baza="Petrol" lider2="petrolu" r="255" g="102" b="51">Petrol</lider>
    </teamy>



PROSZ? BARDZO O POMOC


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-27, 15:26


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Ten kod to ?redni pomys?. Dlaczego? XML masz po stronie clienta - ka?dy gracz mo?e zmieni? sobie dane! ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-27, 16:36


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

nie rozumnie mam po 2 stronach xml . Ale mam problem czemu do ka?dej frakcji si? dodaje!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-27, 17:09


Riot

3X






Wiek: 30
Na forum: 5870 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Ja tylko ostrzegam, by nie by?o za jaki? czas wiadomo?ci ?e co? jest nie tak.
Pytanie czemu dodaje do wszystkich - p?tla przecie? jest tak zrobiona.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-27, 17:22


luki123luki123

Place Game






Wiek: 28
Na forum: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

to jak ja mam zrobi? ??

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: lidera
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panel Lidera Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku