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

Wysłany: 2013-04-12, 16:12


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

"luki123luki123" napisał/a:

jest dobrze przecie?. Jak jest b??d to podaj linijk? bo nie widz?


Co ty kminisz? O czym Ty teraz w og?le piszesz? ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 18:24


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Salon

Kody:
Klient:
        local klient guiGridListGetItemText (salon_Grid[1], guiGridListGetSelectedItem (salon_Grid[1]), 1)
        local auto guiGridListGetItemText (salon_Grid[2], guiGridListGetSelectedItem (salon_Grid[2]), kolumnadajbron1)

function zapytajSprzedarz (klientauto )
        if (source == salon_Button[4]) then
        local klient guiGridListGetItemText (salon_Grid[1], guiGridListGetSelectedItem (salon_Grid[1]), 1)
        local auto guiGridListGetItemText (salon_Grid[2], guiGridListGetSelectedItem (salon_Grid[2]), kolumnadajbron1)
        local kasa guiGridListGetItemText (salon_Grid[2], guiGridListGetSelectedItem (salon_Grid[2]), kolumnadajbron2)
        local score guiGridListGetItemText (salon_Grid[2], guiGridListGetSelectedItem (salon_Grid[2]), kolumnadajbron3)
        
        zapytajOkno guiCreateWindow(329190406188"Kupowanie auta | Salon"false)

        labelZapytanie guiCreateLabel(103338769"Grzacz chce ci przeda? auto "..auto.." za "..kasa..".\n Czy wyra?asz na to zgode?"falsezapytajOkno)
        guiLabelSetHorizontalAlign labelZapytanie"center" )
        buttonTak guiCreateButton(1011216962"Tak"falsezapytajOkno)
        buttonNie guiCreateButton(22811216962"Nie"falsezapytajOkno)
        
    
    addEventHandler("onClientGUIClick"buttonTakwybraneTak)
    addEventHandler("onClientGUIClick"buttonNiewybraneNie)
end
end
addEventHandler("onClientGUIClick"salon_Button[4], zapytajSprzedarz)
addEvent("onZapytajSprzedarz"true)
addEventHandler("onZapytajSprzedarz"getRootElement(), zapytajSprzedarz)

Serwer:
function zapytajSprzedarz(playerklientauto)
    if klient and auto then
        triggerClientEvent(klient"onZapytajSprzedarz"getRootElement(), klientautoplayer)
    end
end


b??d: Otwiera si? okno gui tylko temu kto sprzedaje auto. Co trzeba zmiani? ?eby okno otwiera?o si? klientowi .


Lider


Kody:
Klient:
function OtwieraniePaneluLidera()
        guiGridListClear(lider_Grid[3]) 
        local xml xmlLoadFile "config/lider.xml")
        if xml  then
        local file xmlFindChild (xml,"lider",0)
            for i,lidery in ipairs (xmlNodeGetChildren(file)) do
            local nazwalider xmlNodeGetAttribute (lidery,"lider2")
            local nazwafrakcja xmlNodeGetAttribute (lidery,"acl")
            local rw guiGridListAddRow lider_Grid[3] )
            guiGridListSetItemText (lider_Grid[3], rwkolumnalidernazwaliderfalsefalse )
            guiGridListSetItemText (lider_Grid[3], rwkolumnateamnazwafrakcjafalsefalse )
            guiGridListSetItemColor (lider_Grid[3], rw1255255255255 )
            end
        end    
        guiSetVisible(lider_Window[3], true) 
        showCursor(true)
end
addCommandHandler("lider"OtwieraniePaneluLidera)

function listagraczy ()
guiGridListClear(lider_Grid[2])
for idplayeritem in ipairs(getElementsByType("player")) do 
        local row guiGridListAddRow lider_Grid[2] ) 
        guiGridListSetItemText lider_Grid[2], rowkolumnagetPlayerName playeritem ), falsefalse )     
    end
end

function WejdzDoPaneluLidera ()
    if (source == lider_Button[8]) then
    listagraczy ()
        local Lider guiGridListGetItemText (lider_Grid[3], guiGridListGetSelectedItem (lider_Grid[3]), kolumnalider)
        if Lider ~= "" then
        if (guiGridListGetItemText(lider_Grid[3], guiGridListGetSelectedItem(lider_Grid[3]), kolumnalider) ~= ""then
            guiSetAlpha(lider_Window[3], 0.4)
            guiMoveToBack(lider_Window[3])
            guiSetVisible(lider_Window[2], true)
            outputChatBox("Witaj lideru "..Lider.."!"25500true)
        else
            outputChatBox("Najpierw wybierz Frakcje!"25500true)
        end    
            triggerServerEvent("Lider"getRootElement(), playerLider )
            end
    end
end
addEventHandler "onClientGUIClick"lider_Button[8], WejdzDoPaneluLiderafalse )
addEvent("Liderpokaz"true)
addEventHandler("Liderpokaz"getRootElement(), WejdzDoPaneluLidera)


Serwer:
function WejdzDoPaneluLiderasourceLider )
    local aclem getAccountName(getPlayerAccountsource))
    if isObjectInACLGroup "user." ..aclemaclGetGroup (Lider)) then
    triggerClientEvent(source,"Liderpokaz"getRootElement())
    end
end
addEvent("Lider"true)
addEventHandler("Lider"getRootElement(), WejdzDoPaneluLidera)

Problem jest taki ?e nie patrzy czy ten gracz jest np. LiderPolicji .



Pomo?e kto? dam piwo



Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 18:54


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

Gdzie jest ten button ?:
salon_Button[4]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 17:59


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

1.Gui si? otwiera sprzedaj?cemu nisz klientowi
        local klient guiGridListGetItemText (ammo_Grid[1], guiGridListGetSelectedItem (ammo_Grid[1]), 1)
        local ammo guiGridListGetItemText (ammo_Grid[3], guiGridListGetSelectedItem (ammo_Grid[3]), kolumnaammo1)

function zapytajSprzedarz2 (klientautoplayer)
        local klient guiGridListGetItemText (ammo_Grid[1], guiGridListGetSelectedItem (ammo_Grid[1]), 1)
        local ammo guiGridListGetItemText (ammo_Grid[3], guiGridListGetSelectedItem (ammo_Grid[3]), kolumnaammo1)
        local kasa guiGridListGetItemText (ammo_Grid[3], guiGridListGetSelectedItem (ammo_Grid[3]), kolumnaammo2)
        
        zapytajOkno2 guiCreateWindow(329176406188"Kupowanie broni | Ammo"false)

        labelZapytanie2 guiCreateLabel(103338769"Grzacz chce ci przeda? ammo do broni "..ammo.." za "..kasa..", czy wyra?asz na to zgode?"falsezapytajOkno2)
        buttonTak2 guiCreateButton(1011216962"Tak"falsezapytajOkno2)
        buttonNie2 guiCreateButton(22811216962"Nie"falsezapytajOkno2)
        
    
    addEventHandler("onClientGUIClick"buttonTak2wybraneTak2)
    addEventHandler("onClientGUIClick"buttonNie2wybraneNie2)
end
addEventHandler("onClientGUIClick"ammo_Button[6], zapytajSprzedarz2)
addEvent("onZapytajSprzedarz"true)
addEventHandler("onZapytajSprzedarz"getRootElement(), zapytajSprzedarz2)


2.Panel mandat policji problem z ifem

function (mandatscoregracz)
    local daj getPlayerFromName(gracz)
    if (dajthen
        local money getPlayerMoney(daj)
        local pkt getElementData(daj,"Score")
        if (tonumber(money) > tonumber(mandat)) and (tonumber(score) < tonumber(pkt)) then
Nie sprawdza czy dany gracz mo?e mie? mandat

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 20:16


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Co do punktu nr 2 daj ca?? t? funkcje.
A co do 1 nie rozumiem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 20:56


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

bJacob, nr 1 otwiera si? gui sprzedaj?cemu bron zamiast klientowi a co do nr 2 to ci dam :)
 addEvent("wystawM"true)
addEventHandler("wystawM"getRootElement(),
function (mandatscoregracz)
    local daj getPlayerFromName(gracz)
    if (dajthen
        local money getPlayerMoney(daj)
        local pkt getElementData(daj,"Score")
        if ( tonumber(money) > tonumber(mandat)) and (tonumber(score) < tonumber(pkt)) then
            outputChatBox("Dany gracz posiada tylko #FF0000"..money.."$,#FFFFFF. Nie starczy mu na mandat!"getRootElement(), 255255255true)
        else
            takePlayerMoney(dajmandat)        
            setElementData(daj,"Score"pkt score)
            outputChatBox("Wystawi?e? "..gracz.." mandat w wysoko?ci #00FF00"..mandat.."$#FFFFFF."getRootElement(), 255255255true)
            outputChatBox("Otrzyma?e? mandat w wysoko?ci #00FF00"..mandat.."$#FFFFFF."daj255255255true)
            triggerClientEvent("closeM"getRootElement())
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 21:06


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

triggerClientEvent("closeM"getRootElement())

na
triggerClientEvent(gracz"closeM"getRootElement())


Zawsze gdy przenosisz do klienta even dodawaj na pocz?tku gracza do jakiego ma przenie??.
I zr?b tak samo z wywo?ywaniem eventu onZapytajSprzedarz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-22, 21:36


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Jacob, Dalej if nie dzia?a poprawnie a mam b??d odno?nie
triggerClientEvent(gracz"closeM"getRootElement())


a co do nr1 to te? nie dzia?a poprawnie dalej sie otwiera GUI sprzedaj?cemu

Postaw piwo autorowi tego posta
 

 
Tagi: panele :: frakcyjne
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panele frakcyjne 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