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

Wysłany: 2015-08-17, 09:07


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam jak do tego dorobic ze gracz ktory jest w ACL moze wybrac skina ?

ocal skiny = {278,277,279,35,77,87,266,309}


local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
setElementData(ubrania, "marker_opis", "Wyb?r skina")
setElementInterior(ubrania, 3)
setElementDimension(ubrania, 5353)

okno = guiCreateWindow(997, 179, 262, 381, "Przebieralnia", false)
gridlist = guiCreateGridList(9, 27, 243, 344, false, okno)
guiGridListAddColumn(gridlist, "ID", 0.9)
guiWindowSetSizable(okno, false)
guiSetVisible(okno, false)

for i,v in ipairs(skiny) do
    local row = guiGridListAddRow(gridlist)
    guiGridListSetItemText(gridlist, row, 1, v, false,false)
end

addEventHandler("onClientGUIClick", gridlist, function()
    local model = guiGridListGetItemText(gridlist, guiGridListGetSelectedItem(gridlist))
    
    if model then
        triggerServerEvent("onPlayerEditSkin", getLocalPlayer(), model)
    end
end)

addEventHandler("onClientMarkerHit", ubrania, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
        guiSetVisible(okno, true)
        showCursor(true, false)
    end
end)

addEventHandler("onClientMarkerLeave", ubrania, function(el, md)
    guiSetVisible(okno, false)
    showCursor(false)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-17, 12:06


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020


addEventHandler("onClientMarkerHit", ubrania, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
        guiSetVisible(okno, true)
        showCursor(true, false)
    end
end)

To zamie? na to

addEventHandler("onClientMarkerHit", ubrania, function(el, md)
    if not md or getElementType(el) ~= "player" then return end
    if el == localPlayer then
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "uzupe?nij" ) ) then 
        guiSetVisible(okno, true)
        showCursor(true, false)
    else
    outputChatBox ( "Nie jeste? Policjantem" )
    end
end)

taki przyk?ad powinno dzia?a? :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-17, 12:15


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Hazmudex blagam, jak chcesz laczyc s-side (ACL) z client-side?


Musisz ztriggerowac astro wszystko... np.

addEvent("pokazGUI", true) -- c-side
addEventHandler("pokazGUI", root, function()
guiSetVisible(gui, true)
showCursor(true)
end


taki sam drugi event, tyle zeby znikalo Gui

a potem robisz np. jak masz buttony to :

robisz sobie przyk?adowo :

s-side

addEvent("changeSkin", true)
addEventHandler("changeSkin", resourceRoot, function(which)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(client)), aclGetGroup("grupa")) then
setElementModel(client, which)
end
end

c-side :
addEventHandler("onClientGUIClick", root, function(btn)
if btn == "left" then
if source == btn_od_zmiany_skina then
triggerServerEvent("changeSkin", resourceRoot, skin)
end
end
end

Dopisz sobie etw jakas blokade kt?ra b?dzie sprawdza?a grup? acl tylko przy wybranych skinach

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-17, 12:27


_Haze

Peace Yo!






Wiek: 25
Na forum: 4325 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

a no faktycznie co? mi si? popierdzieli?o dzi?ki ?e poprawi?e? :)

Postaw piwo autorowi tego posta
 

 
Tagi: skin
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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