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

Wysłany: 2015-10-03, 16:26


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Witam. Mam taki problem, ot?? przerabia?em m?j stary system respektu na system g?odu i natrafi?em na problem. Gdy odpal? skrypt to jest dobrze bo usuwa 1 punkt w minut?, ale drugi raz ju? nie usunie. po 100 ustawia na 99 i dalej ju? si? nie ruszy. Wiecie o co chodzi? Przecie? setTimer jest ustawiony na niesko?czono?? razy :)

function dxDraw()
        dxDrawText("G??d:"0335131385tocolor(0255137255), 1.50"pricedown""left""top"falsefalsefalsefalsefalse)
        dxDrawText(getElementData(localPlayer"Respekt") or 0148335261378tocolor(2554343255), 1.50"pricedown""left""top"falsefalsefalsefalsefalse)
end
addEventHandler("onClientRender"rootdxDraw)


local player getLocalPlayer ()
local data getElementData(player"Respekt") or 100
function resp_minuta ()
         setElementData (player"Respekt"data 1)
end
setTimer (resp_minuta60*10000)

function sprawdz_poziom_glodu ()
       glod getElementData (player"Respekt")
        if glod == 0 then
           killPlayer (player)
           outputChatBox ("* Umar?e? z g?odu! Trzeba by?o co? zje??!"25500)
         elseif glod == 10 then
           outputChatBox ("Powoli robisz si? g?odny. Znajd? co? do jedzenia!")
        end
end
setTimer (sprawdz_poziom_glodu60*10000)



Za pomoc dam :piwo:


//EDIT

Kolejny problem to teleportacja do burger shotow. Mam je 2 i jak wejde do burgera w Downtown i chce wyjsc, to teleportuje mnie przed burgera w juniper hollow. O co chodzi? Przecie? markery itp. mam pod inn? nazw? :-?

-- Downtown (San Fierro)
createBlip(-1912.02454828.0793535.19855,102255,0,0,255,0,400)  
wejscie1 createMarker (-1912.02454828.0793536.19855"arrow"1.52552550)
wyjscie1 createMarker (363.27087, -74.970721002.50781"arrow"1.52552550)
setElementDimension(wyjscie10)
setElementInterior(wyjscie110)

addEventHandler("onMarkerHit"wejscie1, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension (el0)
    setElementInterior (el10)
    setElementPosition (el364.66623, -73.733381001.50781)
end)

addEventHandler("onMarkerHit"wyjscie1, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension (el0)
    setElementInterior (el0)
    setElementPosition (el, -1910.66663829.9007035.17188)
end)


-- Juniper Hollow (San Fierro)
createBlip(-2356.425291008.0252750.89844,102255,0,0,255,0,400)  
wejscie2 createMarker (-2355.817141008.1352551.8984"arrow"1.52552550)
wyjscie2 createMarker (363.27087, -74.970721002.50781"arrow"1.52552550)
setElementDimension(wyjscie21)
setElementInterior(wyjscie210)

addEventHandler("onMarkerHit"wejscie2, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension (el1)
    setElementInterior (el10)
    setElementPosition (el364.66623, -73.733381001.50781)
end)

addEventHandler("onMarkerHit"wyjscie2, function(elmd)
    if isPedInVehicle(elthen return end
    setElementDimension (el0)
    setElementInterior (el0)
    setElementPosition (el, -2358.877691007.6281750.69531)
end)


Dodam, ?e to jest ten sam interior. Za to te? dam :piwo: xD

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 17:34


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
1) Date pobierasz raz, nie jest ona aktualizowana na bierz?co.

2) Do wej?cia/wyj?cia doda?:


if not md then return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 17:46


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
A przy okazji mo?esz mi jeszcze poprawi? zapis? Bo jak wyjd? i wejd? to mam znowu 100 g?odu

function odczyt ()
local konto getAccountName(getPlayerAccount(source))
local data getAccountData(konto"Respekt")
    if data then
    setElementData(source"Respekt"data)
    else
    setAccountData(konto"Respekt"100)
    setElementData(source"Respekt"100)
    end
end
addEventHandler 'onPlayerLogin'getRootElement (), odczyt)

function zapis ()
local konto1 getPlayerAccount(source)
    local data1 getElementData(source"Respekt")
    if data1 then
    setAccountData(konto1"Respekt"data1)
    end
end
addEventHandler"onPlayerQuit"getRootElement(), zapis)
addEventHandler"onPlayerLogout"getRootElement(), zapis)
addEventHandler"onResourceStop"getRootElement(), zapis)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-03, 17:52


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
 function odczyt _konto )
local data getAccountData(konto"Respekt")
    if data then
    setElementData(source"Respekt"data)
    else
    setAccountData(konto"Respekt"100)
    setElementData(source"Respekt"100)
    end
end
addEventHandler 'onPlayerLogin'getRootElement (), odczyt)

function zapis (_,konto)
    setAccountData(konto"Respekt", (getElementData(source"Respekt")or 100))
end

addEventHandler"onPlayerLogout"getRootElement(), zapis)

function zapis2 ()

    setAccountData(getPlayerAccount(source), "Respekt", (getElementData(source"Respekt")or 100))
end

addEventHandler"onPlayerQuit"getRootElement(), zapis2)


A co do marker?w:


addEventHandler("onMarkerHit"wyjscie2, function(elmd)
    if isPedInVehicle(elthen return end
    if not md then return end
    setElementDimension (el0)
    setElementInterior (el0)
    setElementPosition (el, -2358.877691007.6281750.69531)
end)


Ostatnio zmieniony przez #404 2015-10-04, 22:01, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-10-04, 21:59


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Za?atwione. Polecia?o :piwo: i R* xD

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Tagi: settimer :: usuwa :: tylko :: raz :: nie :: działa :: teleport
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