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

Wysłany: 2016-08-04, 12:45


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

Witam mo?e kto? mi pom?c z tymi skryptami.Chodzi o to ?eby gracz premium m?g? korzysta? z przebieralni.
Przebieralnia:
local sx,sy = guiGetScreenSize()

-- Wyb?r skina
local m3 = createMarker(204.63,-159.53,1000.52-1, "cylinder", 2, 23,214,255,140)
setElementInterior(m3, 14)
setElementDimension(m3, 5)
local ped = createPed(80, 204.37,-157.54,1000.52, 180)
setElementInterior(ped, 14)
setElementDimension(ped, 5)

-- Ustawienia
local skiny_premium = {18,80,87,15,7,307,29}
local skiny_meskie = {0,1,6,19,20,21,22,23,24,25,28,32,33,34,36,43,44,45,46,47,49,52,58,59,61,66,72,78,79,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,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,308,311}
local skiny_kobiece = {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}

-- 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 m?skie", 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 kobiece", true, false)
    for i,v in ipairs(skiny_kobiece) 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 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, "gracz_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)
    if premium and getElementData(localPlayer, "gracz_premium") ~= 1 then
        outputChatBox("* Ten skin jest dla graczy PREMIUM.(Opcja W Przygotowaniu)")
        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
        --[[if getPlayerName(el) ~= "Split" then
            outputChatBox("* Przebieralnia w trakcie poprawek", el)
            return
        end]]
        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)

Premium:
kasa:
function kasa() 
for _,v in ipairs ( getElementsByType("player") ) do 
local accName = getAccountName ( getPlayerAccount ( v ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Premium" ) ) then  
givePlayerMoney (v, 200) 
outputChatBox("[PREMIUM] Dostajesz 200z? za pelna godzine gry!.",v, 255,255,0, true) 
end 
end 
end 
setTimer ( kasa, 3600000 , 9999 )

Server:
function premium ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
        for _, player in ipairs ( getElementsByType ( "player" ) ) do
            if ( isPlayerOnGroup ( player ) ) then
              outputChatBox ( "#FFFF00[PREMIUM]#FFFFFF".. getPlayerName ( thePlayer ) ..": #FFFF00".. message, player, 255, 255, 255, true )
            end
        end
    else
        outputChatBox ( "#FFFF00*Nie posiadasz aktywnego konta premium.", thePlayer, 255, 255, 255, true )
    end
end
addCommandHandler ( "v", premium )
 
function isPlayerOnGroup ( thePlayer )
    local account = getPlayerAccount ( thePlayer )
    local inGroup = false
    for _, group in ipairs ( { "Premium" } ) do  
        if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
            inGroup = true
            break
        end
    end
 
    return inGroup
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 14:29


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Przy logowaniu je?li gracz jest vipem to nadaj mu warto??
setElementData(gracz, "gracz_premium", 1)

Oczywi?cie zmienn? gracz podmie? na tak? jak? u?ywasz w panelu logowania.

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 15:24


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

"=DC=" napisał/a:

Przy logowaniu je?li gracz jest vipem to nadaj mu warto??
setElementData(gracz, "gracz_premium", 1)

Oczywi?cie zmienn? gracz podmie? na tak? jak? u?ywasz w panelu logowania.

a jak to zrobi? bo akurat w tym to zielony jestem :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 15:31


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Zapewne masz to na ACL :
addEventHandler("onPlayerLogin" root, function()
local konto = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..konto, aclGetGroup ( "VIP" ) ) then
setElementData(source, "gracz_premium", 1)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 15:51


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

"=DC=" napisał/a:

Zapewne masz to na ACL :
addEventHandler("onPlayerLogin" root, function()
local konto = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..konto, aclGetGroup ( "VIP" ) ) then
setElementData(source, "gracz_premium", 1)
end
end)

Sorry mo?e to g?upie pytanie ale gdzie to wstawi??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 15:53


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Wstaw to na sam d?? pliku server i zmie? "VIP"

if isObjectInACLGroup ("user."..konto, aclGetGroup ( "VIP" ) ) then 

na nazw? grupy ACL jak? ma u ciebie vip.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:12


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

function premium ( thePlayer, _, ... )
    local message = table.concat ( { ... }, " " )
    if ( isPlayerOnGroup ( thePlayer ) ) then
        for _, player in ipairs ( getElementsByType ( "player" ) ) do
            if ( isPlayerOnGroup ( player ) ) then
              outputChatBox ( "#FFFF00[PREMIUM]#FFFFFF".. getPlayerName ( thePlayer ) ..": #FFFF00".. message, player, 255, 255, 255, true )
            end
        end
    else
        outputChatBox ( "#FFFF00*Nie posiadasz aktywnego konta premium.", thePlayer, 255, 255, 255, true )
    end
end
addCommandHandler ( "v", premium )
 
function isPlayerOnGroup ( thePlayer )
    local account = getPlayerAccount ( thePlayer )
    local inGroup = false
    for _, group in ipairs ( { "Premium" } ) do  
        if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) )   then
            inGroup = true
            break
        end
    end
 
    return inGroup
end

addEventHandler("onPlayerLogin" root, function()
local konto = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..konto, aclGetGroup ( "Premium" ) ) then
setElementData(source, "gracz_premium", 1)
end
end)

Zrobi?em tak i dalej nie moge bra? tych skin?w

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:17


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Zamie? to na ko?cu server na to poni?ej
addEventHandler("onPlayerLogin" root, function()
local konto = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..konto, aclGetGroup ( "Premium" ) ) then
setElementData(source, "gracz_premium", 1)
outputChatBox ( "#FFFF00*Posiadasz aktywne konta premium.", source, 255, 255, 255, true )
end
end)


I powiedz czy po zalogowaniu pokazuje na czacie:
"*Posiadasz aktywne konta premium."

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:26


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

nic nie wyskakuje

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:27


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

To znaczy ?e nie doda?e? swojego konta do ACL "Premium" :)

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:32


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

napewno jestem dodany tego jestem pewien xd

[ Dodano: 2016-08-04, 16:34 ]
mo?e co? z?e skopiowa?em

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:34


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Na 100% sie nazywa Premium a nie premium ?
Jakie? b??dy w /debugscript 3 ?

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:36


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

na 100%Premium b??d?w 0

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:37


=DC=







Wiek: 36
Na forum: 4085 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

To zamie? jeszcze tak:

addEventHandler("onPlayerLogin" root, function(thePlayer)
local konto = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..konto, aclGetGroup ( "Premium" ) ) then
setElementData(thePlayer, "gracz_premium", 1)
outputChatBox ( "#FFFF00*Posiadasz aktywne konta premium.", thePlayer, 255, 255, 255, true )
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-04, 16:40


STOPseba

Emeryt na scenie MTA






Wiek: 26
Na forum: 3912 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5016

Respekt: 576,3
Respekt: 576,3

[2016-08-04 16:39] ERROR: Loading script failed: seba-Premium/Server.lua:28: ')' expected near 'root'

[ Dodano: 2016-08-04, 16:41 ]
Pewnie co? zle wklejam xd

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Tagi: premium
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