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

Wysłany: 2021-07-22, 21:57


Mis123

Uczeń LUA






Wiek: 31
Na forum: 3093 dni
Posty: 24
Nick w MP: Misiu

Piwa: 14

Respekt: 50

function wyplata()
  local allPlayers getElementsByType("player")
  for index,value in ipairs(allPlayers) do 
    givePlayerMoney(value,100)
dxDrawRectangle(145428441446tocolor(900111), false)
        dxDrawLine(145363189563tocolor(22621946244), 2false)
        dxDrawText("Wyp?‚ata"147731186263tocolor(255255255255), 2.00"sans""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$"1457701885112tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(14543998575":SL-Marker/shrp.png"000tocolor(255255255255), false)
        dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$"14571401885182tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Op?‚ata za Pojazdy:\n 0$"14572011885243tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$"14572681885310tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Suma:\n100$"14573471885389tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
end
end


function onResourceStart(thisResource)
  setTimer wyplata10000)
end
addEventHandler "onResourceStart"getResourceRootElement(getThisResource()), onResourceStart )



Co jest ?le? czas jest na czas robienia skryptu. Brak b??d?w w db3
Po stronie clienta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-23, 14:04


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Czy ty chcesz tym skryptem co X min by kto? dostawa? np hajs dla cza?ego serwera?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-23, 14:27


Mis123

Uczeń LUA






Wiek: 31
Na forum: 3093 dni
Posty: 24
Nick w MP: Misiu

Piwa: 14

Respekt: 50

"killercycDDS" napisał/a:

Czy ty chcesz tym skryptem co X min by kto? dostawa? np hajs dla cza?ego serwera?


Tak, i co ile? tam minut w?a?nie sie pokazywa? ten panel w Dx po czym da? kase

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-23, 16:35


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22


function wyplata()
  
  
          dxDrawRectangle(145428441446tocolor(900111), false)
  
  
          dxDrawLine(145363189563tocolor(22621946244), 2false)
  
  
          dxDrawText("Wyp?‚ata"147731186263tocolor(255255255255), 2.00"sans""center""top"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$"1457701885112tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawImage(14543998575":SL-Marker/shrp.png"000tocolor(255255255255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$"14571401885182tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$"14572011885243tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$"14572681885310tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Suma:\n100$"14573471885389tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
  end

setTimer(function()
    local realTime getRealTime()
    local minute realTime.minute
    local hours realTime.hour
    
    if tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == 10 or tonumber(hours) == 11 or tonumber(hours) == 12 or tonumber(hours) == 13 or tonumber(hours) == 14 or tonumber(hours) == 15 or tonumber(hours) == 16 or tonumber(hours) == 17 or tonumber(hours) == 18 or tonumber(hours) == 19 or tonumber(hours) == 20 or tonumber(hours) == 21 or tonumber(hours) == 22 or tonumber(hours) == 23 then
        if tonumber(minute) == 00 then
            for i,v in ipairs(Element.getAllByType("player")) do
                givePlayerMoney(v,100)
                addEventHandler("onClientRender"vwyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender"vwyplata)
                    end,5000,1)
            end
        end
    end
end999*600)


zobacz czy dzia?a. To co Ci da?em daje co 1h 100$ dla ka?dego i otwiera gui te co stworzy?e? poczym po 5 sek zamyka.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-23, 17:59


Mis123

Uczeń LUA






Wiek: 31
Na forum: 3093 dni
Posty: 24
Nick w MP: Misiu

Piwa: 14

Respekt: 50

"killercycDDS" napisał/a:


function wyplata()
  
  
          dxDrawRectangle(145428441446tocolor(900111), false)
  
  
          dxDrawLine(145363189563tocolor(22621946244), 2false)
  
  
          dxDrawText("Wyp?‚ata"147731186263tocolor(255255255255), 2.00"sans""center""top"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$"1457701885112tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawImage(14543998575":SL-Marker/shrp.png"000tocolor(255255255255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$"14571401885182tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$"14572011885243tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$"14572681885310tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Suma:\n100$"14573471885389tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
  end

setTimer(function()
    local realTime getRealTime()
    local minute realTime.minute
    local hours realTime.hour
    
    if tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == 10 or tonumber(hours) == 11 or tonumber(hours) == 12 or tonumber(hours) == 13 or tonumber(hours) == 14 or tonumber(hours) == 15 or tonumber(hours) == 16 or tonumber(hours) == 17 or tonumber(hours) == 18 or tonumber(hours) == 19 or tonumber(hours) == 20 or tonumber(hours) == 21 or tonumber(hours) == 22 or tonumber(hours) == 23 then
        if tonumber(minute) == 00 then
            for i,v in ipairs(Element.getAllByType("player")) do
                givePlayerMoney(v,100)
                addEventHandler("onClientRender"vwyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender"vwyplata)
                    end,5000,1)
            end
        end
    end
end999*600)


zobacz czy dzia?a. To co Ci da?em daje co 1h 100$ dla ka?dego i otwiera gui te co stworzy?e? poczym po 5 sek zamyka.




Zobacze

[ Dodano: 2021-07-23, 18:08 ]
"killercycDDS" napisał/a:


function wyplata()
  
  
          dxDrawRectangle(145428441446tocolor(900111), false)
  
  
          dxDrawLine(145363189563tocolor(22621946244), 2false)
  
  
          dxDrawText("Wyp?‚ata"147731186263tocolor(255255255255), 2.00"sans""center""top"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$"1457701885112tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawImage(14543998575":SL-Marker/shrp.png"000tocolor(255255255255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$"14571401885182tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$"14572011885243tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$"14572681885310tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
          dxDrawText("Suma:\n100$"14573471885389tocolor(255255255255), 1.70"default-bold""center""center"falsefalsefalsefalsefalse)
  
  
  end

setTimer(function()
    local realTime getRealTime()
    local minute realTime.minute
    local hours realTime.hour
    
    if tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == or tonumber(hours) == 10 or tonumber(hours) == 11 or tonumber(hours) == 12 or tonumber(hours) == 13 or tonumber(hours) == 14 or tonumber(hours) == 15 or tonumber(hours) == 16 or tonumber(hours) == 17 or tonumber(hours) == 18 or tonumber(hours) == 19 or tonumber(hours) == 20 or tonumber(hours) == 21 or tonumber(hours) == 22 or tonumber(hours) == 23 then
        if tonumber(minute) == 00 then
            for i,v in ipairs(Element.getAllByType("player")) do
                givePlayerMoney(v,100)
                addEventHandler("onClientRender"vwyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender"vwyplata)
                    end,5000,1)
            end
        end
    end
end999*600)


zobacz czy dzia?a. To co Ci da?em daje co 1h 100$ dla ka?dego i otwiera gui te co stworzy?e? poczym po 5 sek zamyka.



B??d w linijce 118 : attempt to index global 'Element' (a nil value)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-23, 18:20


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

missa waln??em zmie? to

for i,v in ipairs(Element.getAllByType("player")) do


na to

for i,v in ipairs(getElementsByType("player")) do


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-24, 00:04


Mis123

Uczeń LUA






Wiek: 31
Na forum: 3093 dni
Posty: 24
Nick w MP: Misiu

Piwa: 14

Respekt: 50

"killercycDDS" napisał/a:

missa waln??em zmie? to

for i,v in ipairs(Element.getAllByType("player")) do


na to

for i,v in ipairs(getElementsByType("player")) do


?le co?, linijka 120

BadArgument 'givePlayerMoney' [Expected number at argument 1, got player]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-07-24, 13:36


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Zacznijmy od tego, ?e strasznie pomiesza?e? wszystko. givePlayerMoney po stronie c-side nie posiada argumentu gracza, tylko sam? kwot?



Więcej informacji znajdziesz w Wikipedii MTA:

givePlayerMoney



Po drugie, gdzie jest onClientRender skoro tworzysz dx-y?

Postaw piwo autorowi tego posta
 

 
Tagi: wypłata
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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