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

Wysłany: 2015-08-16, 21:25


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam jak dorobi? do tego ?e tylko gracz kt?ry jest w ACL Fc-Straz moze wybrac skina ;?

local 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, 14:55


MikeY







Wiek: 25
Na forum: 4108 dni
Posty: 3
Nick w MP: Retro



Respekt: 50

u?yj funkcji isObjectInACLGroup

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-17, 20:39


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Spr?buj

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


local playerName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
 if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup ( "Fc-Straz" ) ) then
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
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, 21:12


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

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

sebik, ja ju? mu to da?em w jego drugim temacie.

ps. acl na c-side?

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, 21:18


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

AstroStudio, Co? z tym pokombinuj :)

local ubrania = createMarker(x, y, z, 'cylinder', 2.0, 255, 0, 0, 0)
setElementInterior(ubrania, 3)
setElementDimension(ubrania, 5353)
 
function MarkerHit( hitElement, matchingDimension )
    if matchingDimension then
        if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Fc-Straz") ) then
            triggerClientEvent(hitElement, "nazwa", hitElement)
        end
    end
end
addEventHandler( "onMarkerHit", ubrania, MarkerHit)


[ Dodano: 2015-08-18, 00:23 ]
oczywi?cie server

Postaw piwo autorowi tego posta
 

 
Tagi: skiny
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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