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

Wysłany: 2016-11-13, 16:20


krystek77







Wiek: 27
Na forum: 4031 dni
Posty: 135
Nick w MP: Krystek

Piwa: 176

Respekt: 125,3
Respekt: 125,3

Witam chcialbym zrobic alby US mogli gracze ktorzy maja konto premium



local car createMarker(-88.921035.3519.89-0.9"cylinder"3.525500125)
local text=createElement("text")
setElementData(text"scale"1.6)
setElementData(text"name""Modernizacja pojazd?w\nZwi?kszanie osi?g?w auta!")
setElementPosition(text, -88.921035.3519.89)
local Player getLocalPlayer()

addEventHandler("onClientResourceStart"resourceRoot,
    function()
    local screenWscreenH guiGetScreenSize()
        gui guiCreateWindow((screenW 544) / 2, (screenH 479) / 2544479"Panel modernizacji pojazdu"false)
        guiWindowSetSizable(guifalse)
        guiSetAlpha(gui1.00)

        napis guiCreateLabel(102052858"Witaj w systemie modernizacji pr?dko?ci, poni?ej wy?wietlono nasz? ofert?. Ka?da z opcji jest opisana, pami?taj ?e nie akceptujemy zwrot?w za zam?wion? modernizacje, zastan?w si? kilka razy zanim klikniesz przycisk, po klikni?ciu, nie b?dzie odwrotu."falsegui)
        guiSetFont(napis"default-bold-small")
        guiLabelSetHorizontalAlign(napis"left"true)
        montui guiCreateButton(11116032564"US1\nKoszt: 280.000 PLN\nDolicz: 20.000 PLN"falsegui)
        textxxd guiCreateLabel(11123432547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 10 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(textxxd"default-bold-small")
        guiLabelSetHorizontalAlign(textxxd"left"true)
        naped guiCreateButton(11129132564"US2\nKoszt: 480.000 PLN\nDolicz: 20.000 PLN"falsegui)
        text guiCreateLabel(11136532547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 20 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(text"default-bold-small")
        guiLabelSetHorizontalAlign(text"left"true)
        closex guiCreateButton(11142232547"Zako?cz"falsegui)
        cznacz guiCreateButton(1118632564"Naped 4x4\nKoszt: 90.000 PLN\nDolicz: 10.000 PLN"falsegui)
        guiSetVisible(guifalse)
    end
)

function hit(el)
if el == localPlayer then
if getPedOccupiedVehicle(elthen
if getElementData(el"player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop"255255255) return end
if getPlayerName(getVehicleController(getPedOccupiedVehicle(el))) == getPlayerName(elthen
setElementFrozen(getPedOccupiedVehicle(el), true)
guiSetVisible(guitrue)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit"carhit)

addEventHandler("onClientGUIClick"resourceRoot,
    function()
        if source == closex then
            guiSetVisible(gui,false)
            showCursor(false)
        end
        if source == naped then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk2"PlayerPlayer)
        end
        end
        if source == cznacz then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("naped"PlayerPlayer)
        end
        end
        if source == montui then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk1"PlayerPlayer)
        end
        end
    end
)



Przerobilem to:

if getElementData(el"player:organization") ~= "Eazy Workshop" then 


Na


if getElementData(el"player:premium") ~=  then 

i nie chodzi


Za pomoc piwko + szybka odpowiedz rep

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 16:40


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

Je?li system vip ustawia element dat? to po poprawce powinno dzia?a?.

if getElementData(el"player:premium")==true  then 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 16:55


krystek77







Wiek: 27
Na forum: 4031 dni
Posty: 135
Nick w MP: Krystek

Piwa: 176

Respekt: 125,3
Respekt: 125,3


local car createMarker(-88.921035.3519.89-0.9"cylinder"3.525500125)
local text=createElement("text")
setElementData(text"scale"1.6)
setElementData(text"name""Modernizacja pojazd?w\nZwi?kszanie osi?g?w auta!")
setElementPosition(text, -88.921035.3519.89)
local Player getLocalPlayer()

addEventHandler("onClientResourceStart"resourceRoot,
    function()
    local screenWscreenH guiGetScreenSize()
        gui guiCreateWindow((screenW 544) / 2, (screenH 479) / 2544479"Panel modernizacji pojazdu"false)
        guiWindowSetSizable(guifalse)
        guiSetAlpha(gui1.00)

        napis guiCreateLabel(102052858"Witaj w systemie modernizacji pr?dko?ci, poni?ej wy?wietlono nasz? ofert?. Ka?da z opcji jest opisana, pami?taj ?e nie akceptujemy zwrot?w za zam?wion? modernizacje, zastan?w si? kilka razy zanim klikniesz przycisk, po klikni?ciu, nie b?dzie odwrotu."falsegui)
        guiSetFont(napis"default-bold-small")
        guiLabelSetHorizontalAlign(napis"left"true)
        montui guiCreateButton(11116032564"US1\nKoszt: 280.000 PLN\nDolicz: 20.000 PLN"falsegui)
        textxxd guiCreateLabel(11123432547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 10 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(textxxd"default-bold-small")
        guiLabelSetHorizontalAlign(textxxd"left"true)
        naped guiCreateButton(11129132564"US2\nKoszt: 480.000 PLN\nDolicz: 20.000 PLN"falsegui)
        text guiCreateLabel(11136532547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 20 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(text"default-bold-small")
        guiLabelSetHorizontalAlign(text"left"true)
        closex guiCreateButton(11142232547"Zako?cz"falsegui)
        cznacz guiCreateButton(1118632564"Naped 4x4\nKoszt: 90.000 PLN\nDolicz: 10.000 PLN"falsegui)
        guiSetVisible(guifalse)
    end
)

function hit(el)
if el == localPlayer then
if getPedOccupiedVehicle(elthen
if getElementData(el"player:premium")==true  then  outputChatBox("Chodzi czy nie ...."255255255) return end
if getPlayerName(getVehicleController(getPedOccupiedVehicle(el))) == getPlayerName(elthen
setElementFrozen(getPedOccupiedVehicle(el), true)
guiSetVisible(guitrue)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit"carhit)

addEventHandler("onClientGUIClick"resourceRoot,
    function()
        if source == closex then
            guiSetVisible(gui,false)
            showCursor(false)
        end
        if source == naped then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk2"PlayerPlayer)
        end
        end
        if source == cznacz then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("naped"PlayerPlayer)
        end
        end
        if source == montui then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk1"PlayerPlayer)
        end
        end
    end
)


Nie chodzi

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 16:57


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

system vip nie ustawia element daty. Bez dost?pu do niego nie zrobi? za wiele.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 17:14


krystek77







Wiek: 27
Na forum: 4031 dni
Posty: 135
Nick w MP: Krystek

Piwa: 176

Respekt: 125,3
Respekt: 125,3

Nie wiem czy to dobrze, daje ci automat do kupna premium:




api="ApiKrystiankaD:"
function getPremiumDate(plr)
    local queryA=exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:uid"))
    if (queryA and #queryA > 0) then
        return queryA[1].premiumdate
    end
    return false
end


function setPremiumDay(plr,days)
    if getPremiumDate(plrthen
    local queryA=exports['ogrpg-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(premiumdate) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
    return end
    local queryA=exports['ogrpg-db']:dbSet(string.format("UPDATE ogrpg_users SET premiumdate = DATE(curdate()) + INTERVAL %d DAY WHERE id=%d",days,getElementData(plr,"player:uid")))
end

addEvent("premiumActive"true)
addEventHandler("premiumActive"root, function(code,amount,number)
    if not code then return end
    outputDebugString(code..":"..amount)
    local x=exports['ogrpg-db']:dbGet("SELECT * from ogrpg_premium_code where code=?",code)
    if and #x > 0 then
        if x[1].active 1 then outputChatBox("*B??dny -Kod",client) return end
        local xamount tonumber(x[1].amount)
        if xamount == tonumber(amountthen
        exports['ogrpg-db']:dbSet("UPDATE ogrpg_premium_code set active=0,active_date=NOW(),active_uid=? where code=?",getElementData(client,"player:uid"),code)
        if tonumber(amount) == 1508 then amount 15 else amount 30 end
        setPremiumDay(client,amount)
        triggerEvent("save:player",root,client)
        triggerEvent("load:player",root,client)
        setElementData(client,"player:premium",true)
        outputChatBox("Kupiono konto premium na "..amount.." dni! Weso?ego dnia !"client)
        else
        outputChatBox("B??dny ekod",client) return
        end
    return end
    local query=string.format("https://admin.serverproject.pl/api/smsapi.php?key=be51e990f8736cde3013696bc&do=checkSaldo"number,code,amount)
    fetchRemotequeryresult,"",falseclient,amount,number)
end)

function result(responseDataerrnoplayerToReceive,amount)
    if errno == 0 then
  local x split(responseData,",")
    if not x then return end
    if string.find(x[1],"1"then
        if tonumber(amount) == 1508 then amount 15 else amount 30 end
        setPremiumDay(playerToReceive,amount)
        outputChatBox("Kupiono konto premium na "..amount.." dni! Weso?ego dnia !"playerToReceive)
    --`    setElementData(playerToReceive,"player:premium", true)
        triggerEvent("save:player",root,playerToReceive)
        triggerEvent("load:player",root,playerToReceive)
    else
        outputChatBox("B??dny Kod ("..responseData..")", playerToReceive)
--        outputChatBox("*B??dny Kod", client)
    end
    end
end

addCommandHandler("dajvipa",function(plr,cmd,cel,dni)
    if exports['dutyadmin']:getAdmin(plr,3) or exports['dutyadmin']:getAdmin(plr,4) then
    if not cel then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
    if not tonumber(dni) then outputChatBox("/dajvipa [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni dla "..getPlayerName(target):gsub("#%x%x%x%x%x%x",""), plr)
        outputChatBox("Otrzymales konto premium na "..dni.." dni od "..getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), target)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
        setElementData(target,"player:premium",true)
    end
end)

addCommandHandler("losvip",function(plr)
    if exports['dutyadmin']:getAdmin(plr,4) then
    local los = getRandomPlayer()
    if not los then return end
        setPremiumDay(los,1)
        outputChatBox("Losowanie konta premium na 1 dzie?..", root)
        outputChatBox("Losowe konto PREMIUM otrzymuje gracz o nicku "..getPlayerName(los):gsub("#%x%x%x%x%x%x","").." na 1 dzie?", root)
        outputChatBox("Otrzymales konto premium na 1 dzie?.", los)
        triggerEvent("save:player",root,los)
        triggerEvent("load:player",root,los)
        setElementData(los,"player:premium",true)
    end
end)

addCommandHandler("losvip2",function(plr)
    if exports['dutyadmin']:getAdmin(plr,4) then
    local los2 = getRandomPlayer()
    if not los2 then return end
        setPremiumDay(los2,30)
        outputChatBox("Losowanie konta premium na 30 dni..", root)
        outputChatBox("Losowe konto PREMIUM otrzymuje gracz o nicku "..getPlayerName(los2):gsub("#%x%x%x%x%x%x","").." na 30 dni!", root)
        outputChatBox("Otrzymales konto premium na 30 dni.", los2)
        triggerEvent("save:player",root,los2)
        triggerEvent("load:player",root,los2)
        setElementData(los2,"player:premium",true)
    end
end)

function RGBToHex(red, green, blue, alpha)
    if ( (red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255) ) ) then
        return nil
    end
    if ( alpha ) then
        return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X", red,green,blue)
    end
end

addCommandHandler("losvip3",function(plr)
    if exports['dutyadmin']:getAdmin(plr,4) then
    for k,v in ipairs(getElementsByType ( "player" )) do
    if not getElementData(v, "player:uid") then return end
        iledni=3
        setPremiumDay(v,iledni)
        triggerEvent("save:player",root,v)
        triggerEvent("load:player",root,v)
        setElementData(v,"player:premium",true)
                gracze=v
                end
    end
    --outputChatBox("Z powodu dobrego humoru , ca?y serwer otrzyma? premium na "..iledni.." dni!", gracze, 255, 255, 255)
end)

addCommandHandler("losvip3",function(plr)
if exports['dutyadmin']:getAdmin(plr,4) then
outputChatBox("Z powodu dobrego humoru Administracji, ca?y serwer otrzyma? premium na "..iledni.." dzie?!", root, 0, 192, 255)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 17:20


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

Czy podczas wchodzenia w marker jeste? w poje?dzie?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 17:21


krystek77







Wiek: 27
Na forum: 4031 dni
Posty: 135
Nick w MP: Krystek

Piwa: 176

Respekt: 125,3
Respekt: 125,3

Tak chce aby gracze wjezdrzali w marker i wyskakiwa? gui'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 17:27


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


    local screenWscreenH guiGetScreenSize()
      local  gui guiCreateWindow((screenW 544) / 2, (screenH 479) / 2544479"Panel modernizacji pojazdu"false)
        guiWindowSetSizable(guifalse)
        guiSetAlpha(gui1.00)

      local  napis guiCreateLabel(102052858"Witaj w systemie modernizacji pr?dko?ci, poni?ej wy?wietlono nasz? ofert?. Ka?da z opcji jest opisana, pami?taj ?e nie akceptujemy zwrot?w za zam?wion? modernizacje, zastan?w si? kilka razy zanim klikniesz przycisk, po klikni?ciu, nie b?dzie odwrotu."falsegui)
        guiSetFont(napis"default-bold-small")
        guiLabelSetHorizontalAlign(napis"left"true)
     local   montui guiCreateButton(11116032564"US1\nKoszt: 280.000 PLN\nDolicz: 20.000 PLN"falsegui)
       local textxxd guiCreateLabel(11123432547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 10 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(textxxd"default-bold-small")
        guiLabelSetHorizontalAlign(textxxd"left"true)
        local naped guiCreateButton(11129132564"US2\nKoszt: 480.000 PLN\nDolicz: 20.000 PLN"falsegui)
      local  text guiCreateLabel(11136532547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 20 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(text"default-bold-small")
        guiLabelSetHorizontalAlign(text"left"true)
       local  closex guiCreateButton(11142232547"Zako?cz"falsegui)
       local cznacz guiCreateButton(1118632564"Naped 4x4\nKoszt: 90.000 PLN\nDolicz: 10.000 PLN"falsegui)
        guiSetVisible(guifalse)


function hit(el)
if el == localPlayer then
if getPedOccupiedVehicle(elthen
if getElementData(el"player:premium")  then  outputChatBox("Chodzi czy nie ...."255255255) return end
if getPlayerName(getVehicleController(getPedOccupiedVehicle(el))) == getPlayerName(elthen
setElementFrozen(getPedOccupiedVehicle(el), true)
guiSetVisible(guitrue)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit"carhit)

addEventHandler("onClientGUIClick"resourceRoot,
    function()
        if source == closex then
            guiSetVisible(gui,false)
            showCursor(false)
        end
        if source == naped then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk2"PlayerPlayer)
        end
        end
        if source == cznacz then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("naped"PlayerPlayer)
        end
        end
        if source == montui then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk1"PlayerPlayer)
        end
        end
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-13, 17:48


krystek77







Wiek: 27
Na forum: 4031 dni
Posty: 135
Nick w MP: Krystek

Piwa: 176

Respekt: 125,3
Respekt: 125,3

Nie wiem to cos co zrobiles nie chcialo dzialac...


Poprawilem na takie co? i dalej to samo



local car createMarker(-88.921035.3519.89-0.9"cylinder"3.525500125)
local text=createElement("text")
setElementData(text"scale"1.6)
setElementData(text"name""Modernizacja pojazd?w\nZwi?kszanie osi?g?w auta!")
setElementPosition(text, -88.921035.3519.89)
local Player getLocalPlayer()

addEventHandler("onClientResourceStart"resourceRoot,
       function()
    local screenWscreenH guiGetScreenSize()
      local  gui guiCreateWindow((screenW 544) / 2, (screenH 479) / 2544479"Panel modernizacji pojazdu"false)
        guiWindowSetSizable(guifalse)
        guiSetAlpha(gui1.00)

      local  napis guiCreateLabel(102052858"Witaj w systemie modernizacji pr?dko?ci, poni?ej wy?wietlono nasz? ofert?. Ka?da z opcji jest opisana, pami?taj ?e nie akceptujemy zwrot?w za zam?wion? modernizacje, zastan?w si? kilka razy zanim klikniesz przycisk, po klikni?ciu, nie b?dzie odwrotu."falsegui)
        guiSetFont(napis"default-bold-small")
        guiLabelSetHorizontalAlign(napis"left"true)
     local   montui guiCreateButton(11116032564"US1\nKoszt: 280.000 PLN\nDolicz: 20.000 PLN"falsegui)
       local textxxd guiCreateLabel(11123432547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 10 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(textxxd"default-bold-small")
        guiLabelSetHorizontalAlign(textxxd"left"true)
        local naped guiCreateButton(11129132564"US2\nKoszt: 480.000 PLN\nDolicz: 20.000 PLN"falsegui)
      local  text guiCreateLabel(11136532547"Dzi?ki temu ulepszeniu, pojazd gracza jest bardziej przyczepny i potrafi osi?gn?? a? o 20 km/h wi?cej ni? zwyk?y pojazd."falsegui)
        guiSetFont(text"default-bold-small")
        guiLabelSetHorizontalAlign(text"left"true)
       local  closex guiCreateButton(11142232547"Zako?cz"falsegui)
       local cznacz guiCreateButton(1118632564"Naped 4x4\nKoszt: 90.000 PLN\nDolicz: 10.000 PLN"falsegui)
        guiSetVisible(guifalse)
      end
)
function hit(el)
if el == localPlayer then
if getPedOccupiedVehicle(elthen
if getElementData(el"player:premium")  then  outputChatBox("Chodzi czy nie ...."255255255) return end
if getPlayerName(getVehicleController(getPedOccupiedVehicle(el))) == getPlayerName(elthen
setElementFrozen(getPedOccupiedVehicle(el), true)
guiSetVisible(guitrue)
showCursor(true)
end
end
end
end
addEventHandler("onClientMarkerHit"carhit)

addEventHandler("onClientGUIClick"resourceRoot,
    function()
        if source == closex then
            guiSetVisible(gui,false)
            showCursor(false)
        end
        if source == naped then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk2"PlayerPlayer)
        end
        end
        if source == cznacz then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("naped"PlayerPlayer)
        end
        end
        if source == montui then
        if isElementWithinMarker(Playercarthen
        triggerServerEvent ("mk1"PlayerPlayer)
        end
        end
    end
)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-15, 12:23


PapaSmerf







Wiek: 25
Na forum: 3525 dni
Posty: 237

Piwa: 3857

Respekt: 64


if getElementData(el"player:premium")== 1  then 

spr?buj tak

Postaw piwo autorowi tego posta
 

 
Tagi: cos :: nie :: tak :: dla :: 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 » cos nie tak US dla Premium 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