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

Wysłany: 2016-07-30, 21:13


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam ma problem ze skinshopem:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local sx,sy = guiGetScreenSize()

-- Wyb?r skina
local m3 = createMarker(207.42,-100.33,1004.26, "cylinder", 1.8, 255, 255, 255, 255)
setElementInterior(m3, 3)


-- Ustawienia
local skiny_premium = {222,223,224,225,226,227}
local skiny_meskie = {0,1,6,7,19,20,21,22,23,24,25,28,29,32,33,34,36,43,44,45,46,47,49,52,58,59,61,66,72,78,79,80,81,82,83,84,95,96,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,120,122,123,124,133,134,136,137,142,143,144,146,147,155,158,160,163,164,165,167,170,173,174,175,176,177,179,184,185,186,187,188,189,202,203,204,210,217,220,223,228,229,236,240,241,242,247,248,249,250,252,253,255,260,262,264,269,270,271,272,290,291,292,293,294,295,296,297,299,300,303,306,307,308,311,12,13,31,38,39,40,41,53,55,88,91,93,135,138,139,140,145,148,150,169,192,193,197,198,201,205,211,216,219,233,257}
local skiny_gold = {293,295,296,297,298,299,300}

-- GUI
local sp = {}
sp.pr_okno = guiCreateWindow(990/1280*sx, 200/720*sy, 270/1280*sx, 447/720*sy, "Wybierz skin", false)
guiWindowSetMovable(sp.pr_okno, false)
guiWindowSetSizable(sp.pr_okno, true)
guiSetVisible(sp.pr_okno, false)
guiSetAlpha(sp.pr_okno, 0.9)

sp.pr_grid = guiCreateGridList(12/1280*sx, 36/720*sy, 248/1280*sx, 389/720*sy, false, sp.pr_okno)
guiGridListSetSortingEnabled(sp.pr_grid, false)
guiGridListAddColumn(sp.pr_grid, "SKIN", 0.9)

-- Ustawienia2
function przebieralniaStart()
    guiGridListClear(sp.pr_grid)

    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny zwyk?e", true, false)
    for i,v in ipairs(skiny_meskie) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
    end

    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny GOLD", true, false)
    for i,v in ipairs(skiny_gold) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
        guiGridListSetItemData(sp.pr_grid, row, 1, "gold")
        guiGridListSetItemColor(sp.pr_grid, row, 1, 255, 100, 0)
    end
    
    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny PREMIUM", true, false)
    for i,v in ipairs(skiny_premium) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
        guiGridListSetItemData(sp.pr_grid, row, 1, "premium")
        guiGridListSetItemColor(sp.pr_grid, row, 1, 255, 255, 0)
    end
end

-- Sprawdzanie
addEventHandler("onClientGUIClick", sp.pr_grid, function()
    local selectedRow, selectedCol = guiGridListGetSelectedItem(sp.pr_grid)
    if not selectedRow or selectedCol ~= 1 then return end
    local premium = guiGridListGetItemData(sp.pr_grid, selectedRow, selectedCol)
    local gold = guiGridListGetItemData(sp.pr_grid, selectedRow, selectedCol)
    if premium and getElementData(localPlayer, "premium") ~= 1 then
        outputChatBox("* Ten skin jest dla graczy PREMIUM.")
        return
    end
    if gold and getElementData(localPlayer, "gold") ~= 2 then
        outputChatBox("* Ten skin jest dla graczy GOLD.")
        return
    end
    local model = guiGridListGetItemText(sp.pr_grid, selectedRow, selectedCol)
    if not model then return end
    triggerServerEvent("changeSkin", localPlayer, tonumber(model))
end)

-- Ustawienia 2
addEventHandler("onClientMarkerHit", m3, function(el,md)
    if el ~= localPlayer then return end
    if guiGetVisible(sp.pr_okno) == false then
        przebieralniaStart()
        showCursor(true, false)
        guiSetVisible(sp.pr_okno, true)
    end
end)

-- Ustawienia 3
addEventHandler("onClientMarkerLeave", m3, function(el, md)
    if el ~= localPlayer then return end
    if guiGetVisible(sp.pr_okno) == true then
        showCursor(false)
        guiSetVisible(sp.pr_okno, false)
    end
end)


Gdy wybieram skina golda pisze mi, ?e * TEN SKIN JEST DLA GRACZY PREMIUM
a powinno pisa?: TEN SKIN JEST DLA GRACZY GOLD

I nie wiem czemu mam golda i premium i nie moge skin?w wybiera?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 21:20


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

zmie? to
 then
        outputChatBox("* Ten skin jest dla graczy PREMIUM.")


z PREMIUM na GOLD

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
local sx,sy = guiGetScreenSize()

-- Wyb?r skina
local m3 = createMarker(207.42,-100.33,1004.26, "cylinder", 1.8, 255, 255, 255, 255)
setElementInterior(m3, 3)


-- Ustawienia
local skiny_premium = {222,223,224,225,226,227}
local skiny_meskie = {0,1,6,7,19,20,21,22,23,24,25,28,29,32,33,34,36,43,44,45,46,47,49,52,58,59,61,66,72,78,79,80,81,82,83,84,95,96,99,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,120,122,123,124,133,134,136,137,142,143,144,146,147,155,158,160,163,164,165,167,170,173,174,175,176,177,179,184,185,186,187,188,189,202,203,204,210,217,220,223,228,229,236,240,241,242,247,248,249,250,252,253,255,260,262,264,269,270,271,272,290,291,292,293,294,295,296,297,299,300,303,306,307,308,311,12,13,31,38,39,40,41,53,55,88,91,93,135,138,139,140,145,148,150,169,192,193,197,198,201,205,211,216,219,233,257}
local skiny_gold = {293,295,296,297,298,299,300}

-- GUI
local sp = {}
sp.pr_okno = guiCreateWindow(990/1280*sx, 200/720*sy, 270/1280*sx, 447/720*sy, "Wybierz skin", false)
guiWindowSetMovable(sp.pr_okno, false)
guiWindowSetSizable(sp.pr_okno, true)
guiSetVisible(sp.pr_okno, false)
guiSetAlpha(sp.pr_okno, 0.9)

sp.pr_grid = guiCreateGridList(12/1280*sx, 36/720*sy, 248/1280*sx, 389/720*sy, false, sp.pr_okno)
guiGridListSetSortingEnabled(sp.pr_grid, false)
guiGridListAddColumn(sp.pr_grid, "SKIN", 0.9)

-- Ustawienia2
function przebieralniaStart()
    guiGridListClear(sp.pr_grid)

    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny zwyk?e", true, false)
    for i,v in ipairs(skiny_meskie) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
    end

    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny GOLD", true, false)
    for i,v in ipairs(skiny_gold) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
        guiGridListSetItemData(sp.pr_grid, row, 1, "gold")
        guiGridListSetItemColor(sp.pr_grid, row, 1, 255, 100, 0)
    end
    
    local row = guiGridListAddRow(sp.pr_grid)
    guiGridListSetItemText(sp.pr_grid, row, 1, "Skiny PREMIUM", true, false)
    for i,v in ipairs(skiny_premium) do
        local row = guiGridListAddRow(sp.pr_grid)
        guiGridListSetItemText(sp.pr_grid, row, 1, v, false, false)
        guiGridListSetItemData(sp.pr_grid, row, 1, "premium")
        guiGridListSetItemColor(sp.pr_grid, row, 1, 255, 255, 0)
    end
end

-- Sprawdzanie
addEventHandler("onClientGUIClick", sp.pr_grid, function()
    local selectedRow, selectedCol = guiGridListGetSelectedItem(sp.pr_grid)
    if not selectedRow or selectedCol ~= 1 then return end
    local premium = guiGridListGetItemData(sp.pr_grid, selectedRow, selectedCol)
    local gold = guiGridListGetItemData(sp.pr_grid, selectedRow, selectedCol)
    if premium and getElementData(localPlayer, "premium") ~= 1 then
        outputChatBox("* Ten skin jest dla graczy GOLD.")
        return
    end
    if gold and getElementData(localPlayer, "gold") ~= 2 then
        outputChatBox("* Ten skin jest dla graczy GOLD.")
        return
    end
    local model = guiGridListGetItemText(sp.pr_grid, selectedRow, selectedCol)
    if not model then return end
    triggerServerEvent("changeSkin", localPlayer, tonumber(model))
end)

-- Ustawienia 2
addEventHandler("onClientMarkerHit", m3, function(el,md)
    if el ~= localPlayer then return end
    if guiGetVisible(sp.pr_okno) == false then
        przebieralniaStart()
        showCursor(true, false)
        guiSetVisible(sp.pr_okno, true)
    end
end)

-- Ustawienia 3
addEventHandler("onClientMarkerLeave", m3, function(el, md)
    if el ~= localPlayer then return end
    if guiGetVisible(sp.pr_okno) == true then
        showCursor(false)
        guiSetVisible(sp.pr_okno, false)
    end
end)


Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 22:15


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Ale chce aby byly dla golda i premium...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-30, 22:31


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4290 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4661

Respekt: 1436,8
Respekt: 1436,8

Nadajesz gdziekolwiek t? elementdate ?

Poka? mo?e s side.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-31, 11:59


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Tak nadaje element dat? gdy gracz si? zaloguje na serwer.

[ Dodano: 2016-07-31, 12:03 ]
Gdy posiadam premium to mog? wybiera? skiny dla PREMIUM i GOLD.
A gdy posiadam same GOLD to nie mog? wybiera? skin?w dla gold?w i dla premium.

[ Dodano: 2016-07-31, 12:12 ]
Naprawi?em! Do zamkni?cia :)

Postaw piwo autorowi tego posta
 

 
Tagi: skin :: shop
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 shop 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