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: 3234 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(1454, 28, 441, 446, tocolor(9, 0, 0, 111), false)
        dxDrawLine(1453, 63, 1895, 63, tocolor(226, 219, 46, 244), 2, false)
        dxDrawText("Wyp?‚ata", 1477, 31, 1862, 63, tocolor(255, 255, 255, 255), 2.00, "sans", "center", "top", false, false, false, false, false)
        dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$", 1457, 70, 1885, 112, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawImage(1454, 399, 85, 75, ":SL-Marker/shrp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$", 1457, 140, 1885, 182, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Op?‚ata za Pojazdy:\n 0$", 1457, 201, 1885, 243, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$", 1457, 268, 1885, 310, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
        dxDrawText("Suma:\n100$", 1457, 347, 1885, 389, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
end
end


function onResourceStart(thisResource)
  setTimer ( wyplata, 10000, 0 )
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: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

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: 3234 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: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

Respekt: 22


function wyplata()
  
  
          dxDrawRectangle(1454, 28, 441, 446, tocolor(9, 0, 0, 111), false)
  
  
          dxDrawLine(1453, 63, 1895, 63, tocolor(226, 219, 46, 244), 2, false)
  
  
          dxDrawText("Wyp?‚ata", 1477, 31, 1862, 63, tocolor(255, 255, 255, 255), 2.00, "sans", "center", "top", false, false, false, false, false)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$", 1457, 70, 1885, 112, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawImage(1454, 399, 85, 75, ":SL-Marker/shrp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$", 1457, 140, 1885, 182, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$", 1457, 201, 1885, 243, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$", 1457, 268, 1885, 310, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Suma:\n100$", 1457, 347, 1885, 389, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
  end

setTimer(function()
    local realTime = getRealTime()
    local minute = realTime.minute
    local hours = realTime.hour
    
    if tonumber(hours) == 0 or tonumber(hours) == 1 or tonumber(hours) == 2 or tonumber(hours) == 3 or tonumber(hours) == 4 or tonumber(hours) == 5 or tonumber(hours) == 6 or tonumber(hours) == 7 or tonumber(hours) == 8 or tonumber(hours) == 9 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", v, wyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender", v, wyplata)
                    end,5000,1)
            end
        end
    end
end, 999*60, 0)


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: 3234 dni
Posty: 24
Nick w MP: Misiu

Piwa: 14

Respekt: 50

"killercycDDS" napisał/a:


function wyplata()
  
  
          dxDrawRectangle(1454, 28, 441, 446, tocolor(9, 0, 0, 111), false)
  
  
          dxDrawLine(1453, 63, 1895, 63, tocolor(226, 219, 46, 244), 2, false)
  
  
          dxDrawText("Wyp?‚ata", 1477, 31, 1862, 63, tocolor(255, 255, 255, 255), 2.00, "sans", "center", "top", false, false, false, false, false)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$", 1457, 70, 1885, 112, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawImage(1454, 399, 85, 75, ":SL-Marker/shrp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$", 1457, 140, 1885, 182, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$", 1457, 201, 1885, 243, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$", 1457, 268, 1885, 310, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Suma:\n100$", 1457, 347, 1885, 389, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
  end

setTimer(function()
    local realTime = getRealTime()
    local minute = realTime.minute
    local hours = realTime.hour
    
    if tonumber(hours) == 0 or tonumber(hours) == 1 or tonumber(hours) == 2 or tonumber(hours) == 3 or tonumber(hours) == 4 or tonumber(hours) == 5 or tonumber(hours) == 6 or tonumber(hours) == 7 or tonumber(hours) == 8 or tonumber(hours) == 9 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", v, wyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender", v, wyplata)
                    end,5000,1)
            end
        end
    end
end, 999*60, 0)


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(1454, 28, 441, 446, tocolor(9, 0, 0, 111), false)
  
  
          dxDrawLine(1453, 63, 1895, 63, tocolor(226, 219, 46, 244), 2, false)
  
  
          dxDrawText("Wyp?‚ata", 1477, 31, 1862, 63, tocolor(255, 255, 255, 255), 2.00, "sans", "center", "top", false, false, false, false, false)
  
  
          dxDrawText("Wyp?‚ata dla ciebie wynosi:\n 100$", 1457, 70, 1885, 112, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawImage(1454, 399, 85, 75, ":SL-Marker/shrp.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  
  
          dxDrawText("Op?‚ata za Nieruchomo?›?‡:\n 0$", 1457, 140, 1885, 182, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Pojazdy:\n 0$", 1457, 201, 1885, 243, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Op?‚ata za Ubezpieczenie:\n 0$", 1457, 268, 1885, 310, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
          dxDrawText("Suma:\n100$", 1457, 347, 1885, 389, tocolor(255, 255, 255, 255), 1.70, "default-bold", "center", "center", false, false, false, false, false)
  
  
  end

setTimer(function()
    local realTime = getRealTime()
    local minute = realTime.minute
    local hours = realTime.hour
    
    if tonumber(hours) == 0 or tonumber(hours) == 1 or tonumber(hours) == 2 or tonumber(hours) == 3 or tonumber(hours) == 4 or tonumber(hours) == 5 or tonumber(hours) == 6 or tonumber(hours) == 7 or tonumber(hours) == 8 or tonumber(hours) == 9 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", v, wyplata)
                setTimer(function()    
                    removeEventHandler ("onClientRender", v, wyplata)
                    end,5000,1)
            end
        end
    end
end, 999*60, 0)


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: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

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: 3234 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: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

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 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