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

Wysłany: 2019-06-10, 15:15


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Siema mam skrypt na frakcje pod acl i dorobi?em aby po wzi?ciu skina zacz?? liczy? timer kt?ry co 60 sekund dawa? graczowi 50$ lecz niestety gdy chce zej?? z s?u?by to nie niszczy timera i nadaje hajs ci?gle co minute

U?y?em funkcji, destroyElement(wyplata, element)
wyplata - zmienna timera
element - zmienna gracza

Kod brania skina itd:

pickup createPickup 219.69,150.71,1003.02312750)

addEventHandler "onPickupHit"pickup, function(element)
if isObjectInACLGroup ("user."..getAccountName getPlayerAccount element ) ), aclGetGroup "Policja" ) ) then
        if getAccountData getPlayerAccount element ), "stary:skin" then
        destroyElement(wyplataelement)
            id tonumber getAccountData getPlayerAccount element ), "stary:skin" ) )
            setElementModel elementid ) 
            setAccountData getPlayerAccount element ), "stary:skin"false )
            takeWeapon(element3)
            takeWeapon(element23)
        else
            skin tonumber getElementModel element ) )
            setAccountData getPlayerAccount element ), "stary:skin"skin )
            setElementModel element280  )
            giveWeapon element3)
            giveWeapon element23100 )
        local wyplata setTimer ( function()
        givePlayerMoney(element,50)
        end60000)
        end
    end
    end
    end


Pr?bowa?em te? tak:

if isTimer(wplata)then
killTimer(wyplata

Ale nic z tego, ma kto? jaki? pomys??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-06-10, 15:23


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Spr?buj tego:

pickup createPickup 219.69,150.71,1003.02312750)
local wyplata

addEventHandler "onPickupHit"pickup, function(element)
    if isObjectInACLGroup ("user."..getAccountName getPlayerAccount element ) ), aclGetGroup "Policja" ) ) then   
        if getAccountData getPlayerAccount element ), "stary:skin" then
            killTimerwyplata )
            wyplata nil
            id tonumber getAccountData getPlayerAccount element ), "stary:skin" ) )
            setElementModel elementid ) 
            setAccountData getPlayerAccount element ), "stary:skin"false )
            takeWeapon(element3)
            takeWeapon(element23)
        else
            skin tonumber getElementModel element ) )
            setAccountData getPlayerAccount element ), "stary:skin"skin )
            setElementModel element280  )
            giveWeapon element3)
            giveWeapon element23100 )
            wyplata setTimer ( function()
                givePlayerMoney(element50)
            end60000)
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Yami
Wysłany: 2019-06-10, 15:29


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3059 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Dzia?a
Dzi?ki wielkie :)

Postaw piwo autorowi tego posta
 

 
Tagi: zatrzymanie :: timera
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