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

Wysłany: 2016-08-11, 23:29


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Witam mam problem z tym kodem chodzi o to ?eby graczowi si? wyp?ata nalicza?a od momentu wej?cia na serwer
function kasa1() --Policja
    local accName getAccountName(getPlayerAccount(source))
    if isObjectInACLGroup("user."..accNameaclGetGroup("Policja")) then  
        setTimer(function()
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAPD!",source255,255,255true) 
        end,3600000,0)
    end 
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa1)

function kasa2() --Pogotowie
    local accName getAccountName(getPlayerAccount(source))
    if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then  
        setTimer(function()
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAMC!",source255,255,255true) 
        end,3600000,0)
    end 
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa2)

function kasa2() --PSP
    local accName getAccountName(getPlayerAccount(source))
    if isObjectInACLGroup("user."..accNameaclGetGroup("PSP")) then  
        setTimer(function()
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy PSP!",source255,255,255true) 
        end,3600000,0)
    end 
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa2)


Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-12, 02:31


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Pami?taj tylko ze gracz ma godzin? na zalogowanie si? od momentu wej?cia je?li chce dosta? wyp?at? :D :

function kasa1() --Policja
    setTimer(function()
        for k,v in ipairs(getElementsByType("player")) do
            local acc getPlayerAccount(v)
            if isGuestAccount(accthen return end
            local accName getAccountName(acc)
            if (not accNamethen return end 
            if isObjectInACLGroup("user."..accNameaclGetGroup("Policja")) then  
                givePlayerMoney(v5000) 
                outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAPD!",v255,255,255true)
            end
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa1)


function kasa2() --Pogotowie
    setTimer(function()
        for k,v in ipairs(getElementsByType("player")) do
            local acc getPlayerAccount(v)
            if isGuestAccount(accthen return end
            local accName getAccountName(acc)
            if (not accNamethen return end 
            if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then  
                givePlayerMoney(v5000) 
                outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAMC!",v255,255,255true)
            end
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa2)


function kasa3() --Policja
    setTimer(function()
        for k,v in ipairs(getElementsByType("player")) do
            local acc getPlayerAccount(v)
            if isGuestAccount(accthen return end
            local accName getAccountName(acc)
            if (not accNamethen return end 
            if isObjectInACLGroup("user."..accNameaclGetGroup("PSP")) then  
                givePlayerMoney(v5000) 
                outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy PSP!",v255,255,255true)
            end
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa3)


Podpis

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-12, 19:22


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Event na ko?cu funkcji w twoim przypadku jest to:

addEventHandler("onPlayerJoin"getRootElement(), kasa1)

"onPlayerJoin" - czyli do??czenie do gry
wi?c....
onPlayerJoin zamie? na onPlayerLogin:

addEventHandler("onPlayerLogin"getRootElement(), kasa1)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-13, 14:02


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Kalizman, nie mam poj?cia po co chcesz dawa? onPlayerLogin skoro kolega chce ?eby mu liczy?o od momentu wej?cia na serwer :P

STOPseba, tamten kod kt?ry ci da?em jest bugni?ty bo moze sie zdarzy?, ?e o 15:00 wyda kase i o 15:05 te? tutaj poprawi?em:
function kasa1() --Policja
    setTimer(function()
        local acc getPlayerAccount(source)
        if isGuestAccount(accthen return end
        local accName getAccountName(acc)
        if (not accNamethen return end 
        if isObjectInACLGroup("user."..accNameaclGetGroup("Policja")) then  
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAPD!",source255,255,255true)
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa1)


function kasa2() --Pogotowie
    setTimer(function()
        local acc getPlayerAccount(source)
        if isGuestAccount(accthen return end
        local accName getAccountName(acc)
        if (not accNamethen return end 
        if isObjectInACLGroup("user."..accNameaclGetGroup("SAMC")) then  
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy SAMC!",source255,255,255true)
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa2)

function kasa3() --PSP
    setTimer(function()
        local acc getPlayerAccount(source)
        if isGuestAccount(accthen return end
        local accName getAccountName(acc)
        if (not accNamethen return end 
        if isObjectInACLGroup("user."..accNameaclGetGroup("PSP")) then  
            givePlayerMoney(source5000) 
            outputChatBox("[FRAKCJA] Otrzymujesz 5000z? z grupy PSP!",source255,255,255true)
        end
    end,3600000,0)
end 
addEventHandler("onPlayerJoin"getRootElement(), kasa3)


Godzina od wej?cia do zalogowania si? pozostaje bez zmian ;)

Podpis

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-13, 15:03


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Dzi?ki za pomoc

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Tagi: wypłata :: frakcji
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