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

Wysłany: 2016-07-14, 10:44


mixLoLmix2

Programista






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

Piwa: 1915

Respekt: 47,3

Mam problem chodzi o to ze mam gui pod f6 i jak wpisze tam Kod z sms (jest w Config.xml) to ma mi sie pokaza? : Zakupi?es Premium na 30dni a jak klikam Wy?lij to wysakuje mi DB3

SklepSMS\c.lua:101:Bad argument @' GuiSetText (expectated giu-elemt at argument 1, got nill)
Przepisywa?em wi?c mog? byc drobne b??dy

Kod:

Client:


GUIEditor = {
    gridlist = {},
    button = {},
    label = {},
    edit = {}
}

sklepitem = {
    {"Premium","30","dni","Chcesz kupi?? zg?os sie do Administracji"},
    }

sklep guiCreateWindow(141119600475"Sklep Serwerowy"false)
GUIEditor.label[15] = guiCreateLabel(1039058030""falsesklep)
GUIEditor.label[16] = guiCreateLabel(1043058030"Pamietaj: Admin nie odpowiada za ?le wys?anego smsa oraz nie zwraca pieni?dzy!\nsprawdz 10 razy na jaki numer i jaka tre?? ma SMS!"falsesklep)

guiLabelSetHorizontalAlign GUIEditor.label[15], "center" )
guiLabelSetVerticalAlign GUIEditor.label[15], "center" )
guiLabelSetHorizontalAlign GUIEditor.label[16], "center" )
guiLabelSetVerticalAlign GUIEditor.label[16], "center" )

tabPanel guiCreateTabPanel 1020580370falsesklep )
TABA guiCreateTab"Kup punkty"tabPanel )
TABB guiCreateTab"Premium"tabPanel )
guiWindowSetSizable(sklepfalse)

lista guiCreateGridList(103555090falseTABA)
ilosc guiGridListAddColumn(lista,"Ilo?? PP",0.24)
koszt guiGridListAddColumn(lista,"Koszt SMS",0.24)
tresc guiGridListAddColumn(lista,"Tre?? SMSA",0.24)
numer guiGridListAddColumn(lista,"Numer",0.24)

GUIEditor.label[11] = guiCreateLabel(151040020"Krok pierwszy: Wybierz na ile chcesz kupic premium"falseTABA)
GUIEditor.label[12] = guiCreateLabel(1513040020"Krok drugi: Wy?lij sms"falseTABA)
GUIEditor.label[13] = guiCreateLabel(1518540020"Krok trzeci: Wpisz otrzymany kod oraz kod antyspamowy"falseTABA)
GUIEditor.label[14] = guiCreateLabel(1526540020"Krok czwarty: Zatwierd? wpisany kod przyciskiem"falseTABA)


guiLabelSetColor GUIEditor.label[11], 0,255,)
guiLabelSetColor GUIEditor.label[12], 0,255,)
guiLabelSetColor GUIEditor.label[13], 0,255,)
guiLabelSetColor GUIEditor.label[14], 0,255,)

GUIEditor.label[13] = guiCreateLabel(15155400136"Numer:"falseTABA)
GUIEditor.label[14] = guiCreateLabel(150155400136"Tre??:"falseTABA)

GUIEditor.label[2] = guiCreateLabel(1521010016"Wpisz kod sms:"falseTABA)
GUIEditor.edit[1] = guiCreateEdit(11021012018""falseTABA)
GUIEditor.label[3] = guiCreateLabel(1523512016"Przepisz kod:"falseTABA)
GUIEditor.edit[2] = guiCreateEdit(16023512018""falseTABA)
GUIEditor.label[4] = guiCreateLabel(902356016"LOSOWYKOD"falseTABA)
guiEditSetMaxLength GUIEditor.edit[1], )
guiEditSetMaxLength GUIEditor.edit[2], )

GUIEditor.button[1] = guiCreateButton(1029056045"Wyslij"falseTABA)
guiSetVisible (sklepfalse)

for i,v in ipairs (sklepitem) do
  local row guiGridListAddRow (lista)
  guiGridListSetItemText (listarow1v[1], falsetrue)
  guiGridListSetItemText (listarow2v[2], falsetrue)
  guiGridListSetItemText (listarow3v[3], falsetrue)
  guiGridListSetItemText (listarow4v[4], falsetrue)
  
end

function aktualizuj (buttonstateabsoluteXabsoluteYe)
  if (source == listathen
    if (guiGridListGetSelectedItem (lista)) then
      local lol guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 1)
      local numer guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 4)
      local tresc guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 3)
      
      if lol == "10" then
      guiSetText GUIEditor.label[13], "Numer: "..numer.."" )
      guiSetText GUIEditor.label[14], "Tre??: "..tresc.."" )
      elseif lol == "50" then
      guiSetText GUIEditor.label[13], "Numer: "..numer.."" )
      guiSetText GUIEditor.label[14], "Tre??: "..tresc.."" )
      elseif lol == "100" then
      guiSetText GUIEditor.label[13], "Numer: "..numer.."" )
      guiSetText GUIEditor.label[14], "Tre??: "..tresc.."" )
      elseif lol == "200" then
      guiSetText GUIEditor.label[13], "Numer: "..numer.."" )
      guiSetText GUIEditor.label[14], "Tre??: "..tresc.."" )
      end
    end
  end
end
addEventHandler ("onClientGUIClick"listaaktualizuj)

function wyslij (buttonstateabsoluteXabsoluteYe)
  if (source == GUIEditor.button[1]) then
    if (guiGridListGetSelectedItem (lista)) then
      local lol guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 1)
      checka guiGetText(GUIEditor.edit[2])
      checkb guiGetText(GUIEditor.label[4])
      kod guiGetText(GUIEditor.edit[1])
      
      if checka == checkb then
      guiSetText GUIEditor.label[1], "Trwa weryfikacja" )
      guiSetText(GUIEditor.edit[2], "")
      losuj math.random(1,99999999)
      guiSetText(GUIEditor.label[4], losuj)
      triggerServerEvent('SprawdzPoprawnosc'getLocalPlayer(), kodlol)
      else
      guiSetText GUIEditor.label[1], "Podany kod jest nie prawid?owy. Sprawdz czy dobrze wpisa?es\a? jak nadal nie dza?a pisz do Administracji!" )
      guiLabelSetColor GUIEditor.label[1], 255,0,)
      setTimer ( function()
        local lol guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 1)
      if lol == "50" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 6,15 z?). Otrzymasz zwrotny SMS z kodem" )
      elseif lol == "100" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 12,27 z?). Otrzymasz zwrotny SMS z kodem" )
      elseif lol == "200" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 23.37 z?). Otrzymasz zwrotny SMS z kodem" )
      end
    end5000)
      guiSetText(GUIEditor.edit[2], "")
      losuj math.random(1,999)
      guiSetText(GUIEditor.label[4], losuj)
      guiSetText(GUIEditor.label[1], "Blednie przepisany kod!")
      setTimer ( function()
        guiLabelSetColor GUIEditor.label[1], 255,255,255 )
      end5050)
      end
    end
  end
end
addEventHandler ("onClientGUIClick"GUIEditor.button[1], wyslij)

bindKey("f6","down", function()
    if (guiGetVisible(sklep) == falsethen
        guiSetVisible(skleptrue)
        showCursortrue )
        losuj math.random(10000000,99999999)
        guiSetText GUIEditor.label[4], losuj )
    else
        guiSetVisible(sklepfalse)
        showCursorfalse )
    end
end)

function INFORMACJA (infokolor)
guiSetText GUIEditor.label[1], info )
if kolor == "ZIELONY" then
guiLabelSetColor GUIEditor.label[1], 0,255,)
elseif kolor == "CZERWONY" then
guiLabelSetColor GUIEditor.label[1], 255,255,255 )
end
setTimer ( function()
    local lol guiGridListGetItemText (listaguiGridListGetSelectedItem (lista), 1)
    if lol == "50" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 6,15 z?). Otrzymasz zwrotny SMS z kodem" )
      elseif lol == "100" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 12,27 z?). Otrzymasz zwrotny SMS z kodem" )
      elseif lol == "200" then
      guiSetText GUIEditor.label[1], "wy?lij SMS o tre?ci  xxx  na numer  xxx\n(koszt: 23.37 z?). Otrzymasz zwrotny SMS z kodem" )
      end
end5000)
setTimer ( function()
guiLabelSetColor GUIEditor.label[1], 255,255,255 )
end5050)
end
addEvent("INFO"true)
addEventHandler("INFO"getRootElement(), INFORMACJA)


Server:

function sprawdz (kodpotwilosc)
    local xml xmlLoadFile("config.xml")
    if ilosc == "50" then
        local xmlx xmlFindChild(xml"KODA"0)
        local KOD xmlNodeGetChildren(xmlx)
        for i,node in ipairs(KOD) do
            kody xmlNodeGetValue(node)
            if kody == kodpotw then 
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
        setPremiumDay(target,dni)
     outputChatBox "Kupi?e? Premium na 30dni"source0,2550true )
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
        setElementData(target,"player:premium",true)
            xmlDestroyNode(node)
            outputServerLog("GRACZ: " .. getPlayerName(source).." kupi? Premium na 30 Dni")
            info "Kupi?e? Premium na 30 dni ;)"
            kolor "ZIELONY"
            triggerClientEvent(source"INFO",rootinfokolor)
        else
        info "Podany kod SMS jest niepoprawny!"
        kolor "CZERWONY"
        triggerClientEvent(source"INFO",rootinfokolor)
        end
        end

end
addEvent("SprawdzPoprawnosc"true)
addEventHandler("SprawdzPoprawnosc"getRootElement(), sprawdz)



Dodam ze Skrypt znalaz?em na gtao ale on nie dawa? premium tylko co? innego i chca?em przerobic pod premium

Piwko :piwo: :piwo: :piwo: :piwo: Oraz Repka R* R* R* :=: :arrow: :piwo:


// Usune?em linike 101 i mam takie co?


ErrorClient (mixLoLmixtriggerd serverside event SprawdzPoprawnoscbut vev is not added serverside


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-16, 10:55


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

mixLoLmix2, nie masz labelu o takim indeksie GUIEditor.label[1]
Co do tego 2 b??du to mia?e? za ma?o end'?w
function sprawdz (kodpotwilosc)
    local xml xmlLoadFile("config.xml")
    if ilosc == "50" then
        local xmlx xmlFindChild(xml"KODA"0)
        local KOD xmlNodeGetChildren(xmlx)
        for i,node in ipairs(KOD) do
            kody xmlNodeGetValue(node)
            if kody == kodpotw then 
            local target=exports["ogrpg-core"]:findPlayer(plr,cel)
                if not target then
                setPremiumDay(target,dni)
                outputChatBox "Kupi?e? Premium na 30dni"source0,2550true )
                triggerEvent("save:player",root,target)
                triggerEvent("load:player",root,target)
                setElementData(target,"player:premium",true)
                xmlDestroyNode(node)
                outputServerLog("GRACZ: " .. getPlayerName(source).." kupi? Premium na 30 Dni")
                info "Kupi?e? Premium na 30 dni ;)"
                kolor "ZIELONY"
                triggerClientEvent(source"INFO",rootinfokolor)
                end
            else
            info "Podany kod SMS jest niepoprawny!"
            kolor "CZERWONY"
            triggerClientEvent(source"INFO",rootinfokolor)
            end
        end
    end    
end
addEvent("SprawdzPoprawnosc"true)
addEventHandler("SprawdzPoprawnosc"getRootElement(), sprawdz)


Postaw piwo autorowi tego posta
 

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