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

Wysłany: 2018-12-05, 22:14


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

R?wnie? spr?bowa?em, nadal w to samo miejscu, po usuni?ciu tak?e spr?bowa?em tej linijki co mi da?e? wilq, w sensie zmienieniu jej i usuni?ciu bo itak nie dzia?a?u (teraz ju? wkei?em spowrotem j?), te? nadal nie dzia?a?o i tepa?o

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:14


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Zrestartowa?e? skrypt po zmianach?
Je?li tak, musisz szuka? dalej, tak samo: onPlayerWasted oraz spawnPlayer

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:17


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Tak, zrestartowa?em. I teraz zaczynam dalej szuka? tak jak radzisz.
Krzemo, zrobi?em, zastopowa?em skrypt i po wy??czeniu i potem zgini?ciu kamera si? oddala a ja sie nie respie, wi?c nie dzia?a ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:20


Krzemo1234







Wiek: 26
Na forum: 3751 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

Spr?buj w pystories-core/s_base.lua

zamieni? na to

tylko wy??cz tamten skrypt


addEventHandler("onPlayerWasted"root, function()
    plr=source
     if getElementData(client"faction") == "SAPD" then 
            spawnPlayer(clientkordy sapdthen return end
    if getElementData(plr,"player:job"then
        triggerClientEvent(plr,"onFinish"rootplr)
        setElementData(plr,"player:job"false)
    end
    setTimer(function()
        local pos=getElementData(plr,"player:spawn")
        if not pos then return end
        fadeCamera(plrtrue)
        setElementInterior(plr,0)
        setElementDimension(plr,0)
        spawnPlayer(plrpos[1], pos[2], pos[3])
        setCameraTarget(plrplr)
        setElementModel(plrgetElementData(plr"player:skin"))
    end601)
end)


Podpis
Jeśli ci pomogłem zostaw zimne :piwo:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:20


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

A gdzie wrzuci?e? ten nasz kod?

Spr?buj da? do innego skryptu, wy??cz pystories-core i daj zna? o efektach.

Kod:
addEventHandler("onPlayerWasted"getRootElement(), function()
        if getElementData(source"faction") == "SAPD" then 
            spawnPlayer(source2711.452369.876.73)
        else 
            spawnPlayer(source2553.362376.777.91)
        end 
    end)


Krzemo1234 - je?li korzystasz z 'client' w tym kodzie to lepiej nie zajmuj si? LUA, doinformuj si? i wtedy pr?buj pomaga?. Client tylko podczas triggerServerEvent, brawo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:22


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Szuka?em w skrypcie na logowanie

pystories-logging c_zone

Dwa kody:

1.

function closeZones()
    showChat(true)
    showCursor(false)
    fadeCamera(false)
    setElementAlpha(localPlayer,255)
    setElementData(localPlayer,"status","Zalogowany(a)")
    stopSound(data.misc)
    showPlayerHudComponent("all",false)
    showPlayerHudComponent("radar",true)
    showPlayerHudComponent("crosshair",true)
    showPlayerHudComponent("weapon",false)
    showPlayerHudComponent("radar",true)
    showPlayerHudComponent("health",false)
    showPlayerHudComponent("breath",false)
    showPlayerHudComponent("clock",false)
    showPlayerHudComponent("ammo",false)
    data.showed=false
    destroyElement(blurShader)
    -- Usuwamy elementy
    triggerServerEvent("core:spawnPlayer"localPlayer)
    setTimer(triggerEvent2501"gui:start"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
    blur false
end

2.

function closeZones()
    showChat(true)
    showCursor(false)
    fadeCamera(false)
    setElementAlpha(localPlayer,255)
    stopSound(data.misc)
    showPlayerHudComponent("all",false)
    showPlayerHudComponent("radar",true)
    showPlayerHudComponent("crosshair",true)
    showPlayerHudComponent("weapon",true)
    showPlayerHudComponent("health",true)
    showPlayerHudComponent("breath",true)
    showPlayerHudComponent("ammo",true)
    data.showed=false
    destroyElement(blurShader)
    -- Usuwamy elementy
    triggerServerEvent("core:spawnPlayer"localPlayer)
    setTimer(triggerEvent2501"gui:start"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
    blur false
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:23


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wy?lij tre?? eventu 'core:spawnPlayer', mo?esz go znale?? w notepadzie++.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:27


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50


addEvent("core:spawnPlayer"true)
addEventHandler("core:spawnPlayer"root, function()
    local pos=getElementData(source,"player:spawn")
    if not pos then return end
    fadeCamera(sourcetrue)
    spawnPlayer(sourcepos[1], pos[2], pos[3])
    setCameraTarget(source,source)
    toggleControl(source,"fire"false)
    toggleControl(source,"aim_weapon"false)
    local load=loadPlayerData(source)
    if load then outputChatBox("* Pomy?lnie wczytano Twoje dane, ?yczymy mi?ej gry.",sourceend
    setElementData(source,'HS_accountName',getPlayerName(source));
    setElementData(source,"player:online",0)
    if getElementData(source,"player:premium"then 
        local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1"getElementData(source,"player:sid"))
        local resultA=exports["DB2"]:pobierzWyniki(queryA)
        if (resultAthen
            outputChatBox("* Twoje konto premium, wa?ne do " ..resultA["premiumdate"], source)
        end
    end
    triggerClientEvent(source,"core:blipyaut",root,source)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:29


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie, logowanie nie ma tutaj nic do tego.
Musi to by? event onPlayerWasted oraz funkcja w nim spawnPlayer, wy?lij wszystko co zawiera te 2 wy?ej wymienione elementy.

Szukaj w skrypcie 'pystories-core'.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:37


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

1.

addEventHandler("onPlayerWasted"root, function()
    plr=source
    if getElementData(plr,"player:job"then
        triggerClientEvent(plr,"onFinish"rootplr)
        setElementData(plr,"player:job"false)
    end
    setTimer(function()
        fadeCamera(plrtrue)
        setElementInterior(plr,0)
        setElementDimension(plr,0)
        setCameraTarget(plrplr)
        setElementModel(plrgetElementData(plr"player:skin"))
    end601)
end)

2.

addEvent("core:spawnPlayer"true)
addEventHandler("core:spawnPlayer"root, function()
    local pos=getElementData(source,"player:spawn")
    if not pos then return end
    fadeCamera(sourcetrue)
    spawnPlayer(sourcepos[1], pos[2], pos[3])
    setCameraTarget(source,source)
    toggleControl(source,"fire"false)
    toggleControl(source,"aim_weapon"false)
    local load=loadPlayerData(source)
    if load then outputChatBox("* Pomy?lnie wczytano Twoje dane, ?yczymy mi?ej gry.",sourceend
    setElementData(source,'HS_accountName',getPlayerName(source));
    setElementData(source,"player:online",0)
    if getElementData(source,"player:premium"then 
        local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1"getElementData(source,"player:sid"))
        local resultA=exports["DB2"]:pobierzWyniki(queryA)
        if (resultAthen
            outputChatBox("* Twoje konto premium, wa?ne do " ..resultA["premiumdate"], source)
        end
    end
    triggerClientEvent(source,"core:blipyaut",root,source)
end)

3.

setTimer(function()
  for i,v in ipairs(getElementsByType("player")) do
    if not getElementData(v,"player:spawn"then return end
    if isPedDead(vthen
        local pos=getElementData(v,"player:spawn")
        fadeCamera(vtrue)
        setElementInterior(v,0)
        setElementDimension(v,0)
        spawnPlayer(vpos[1], pos[2], pos[3])
        setCameraTarget(vplr)
        setElementModel(vgetElementData(plr"player:skin"))
    end
    if( getPlayerIdleTime(v) > then
    setElementData(v"player:afk"true)
    elseif ( getPlayerIdleTime(v) < then
    setElementData(v"player:afk"false)
    end    
  end
end100000)

4.

addEvent("core:spawnPlayer"true)
addEventHandler("core:spawnPlayer"root, function()
    local pos=getElementData(source,"player:spawn")
    if not pos then return end
    fadeCamera(sourcetrue)
    spawnPlayer(sourcepos[1], pos[2], pos[3])
    setCameraTarget(source,source)
    toggleControl(source,"fire"false)
    toggleControl(source,"aim_weapon"false)
    local load=loadPlayerData(source)
    if load then outputChatBox("* Pomy?lnie wczytano Twoje dane, ?yczymy mi?ej gry.",sourceend
    setElementData(source,'HS_accountName',getPlayerName(source));
    setElementData(source,"player:online",0)
    if getElementData(source,"player:premium"then 
        local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1"getElementData(source,"player:sid"))
        local resultA=exports["DB2"]:pobierzWyniki(queryA)
        if (resultAthen
            outputChatBox("* Twoje konto premium, wa?ne do " ..resultA["premiumdate"], source)
        end
    end
    triggerClientEvent(source,"core:blipyaut",root,source)
end)

5.


setTimer(function()
  for i,v in ipairs(getElementsByType("player")) do
    if not getElementData(v,"player:spawn"then return end
    if isPedDead(vthen
        local pos=getElementData(v,"player:spawn")
        fadeCamera(vtrue)
        setElementInterior(v,0)
        setElementDimension(v,0)
        spawnPlayer(vpos[1], pos[2], pos[3])
        setCameraTarget(vplr)
        setElementModel(vgetElementData(plr"player:skin"))
    end
    if( getPlayerIdleTime(v) > then
    setElementData(v"player:afk"true)
    elseif ( getPlayerIdleTime(v) < then
    setElementData(v"player:afk"false)
    end    
  end
end100000)

Wszystko co znalaz?em pod tymi nazwami co poda?e? w pystories-core

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:45


Krzemo1234







Wiek: 26
Na forum: 3751 dni
Posty: 387
Nick w MP: Krzemo

Piwa: 16

Respekt: 40

spawnPlayer(source, pos[1], pos[2], pos[3])

Te [pos] to miejsce kt?re okre?la gdzie masz si? respi? , nadawane jest przez panel logowania pr?bowa?e? zrobi? to co do g?ry pisa?em ?

Podpis
Jeśli ci pomogłem zostaw zimne :piwo:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:47


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Tak, pr?bowa?em, i efekt taki sam ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 22:58


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Podmie? timer:
setTimer(function()
  for i,v in ipairs(getElementsByType("player")) do
    if not getElementData(v,"player:spawn"then return end
    if isPedDead(vthen
        local pos=getElementData(v,"player:spawn")
        fadeCamera(vtrue)
        setElementInterior(v,0)
        setElementDimension(v,0)
        if getElementData(v"faction") == "SAPD" then 
            spawnPlayer(v2711.452369.876.73)
        else 
            spawnPlayer(v2553.362376.777.91)
        end 
        setCameraTarget(vplr)
        setElementModel(vgetElementData(plr"player:skin"))
    end
    if( getPlayerIdleTime(v) > then
    setElementData(v"player:afk"true)
    elseif ( getPlayerIdleTime(v) < then
    setElementData(v"player:afk"false)
    end    
  end
end100000)


i upewnij si?, ?e masz poni?szy kod w jakim? skrypcie:
addEventHandler("onPlayerWasted"getRootElement(), function()
        if getElementData(source"faction") == "SAPD" then 
            spawnPlayer(source2711.452369.876.73)
        else 
            spawnPlayer(source2553.362376.777.91)
        end 
    end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Kulegg
Wysłany: 2018-12-05, 23:02


Kulegg







Wiek: 46
Na forum: 3125 dni
Posty: 283

Piwa: 20

Respekt: 50

Dzia?a, lecz spawnuje tylko w kordach gracza tam gdzie ustawi?em, a jak zgin? jako sapd to respi tam gdzie gracza

[ Dodano: 2018-12-05, 23:05 ]
Edit: zmieni?em w kodzie

 if getElementData(source"faction") == "SAPD" then 

na

if getElementData(source"player:faction") == "SAPD" then 

i dzia?a ! :) dzi?kuje i jeszcze mam pytanie, czy da?oby rade ?eby na np cuboid zrobic ze jak gracz np jest w lv i cuboid jakby jest zrobiony w lv to go respi w ustalone kordy w lv, a jak jest drugi cuboid na ls i gracz zginal w ls to go respi w ustalonych kordach w ls? Tak samo w sapd? Oczywi?cie piwko daje wam obu za pomoc!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-05, 23:11


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jasne, ?e mo?na. Ale lepiej b?dzie por?wnywa? koordynaty X Y z miejsca, gdzie zgin??.
Tak b?dzie ?atwiej i obejdzie si? bez zb?dnych cuboid?w ale oczywi?cie wyb?r nale?y do Ciebie.

Przydatne funkcje:

Więcej informacji znajdziesz w Wikipedii MTA:

getElementPosition


Więcej informacji znajdziesz w Wikipedii MTA:

spawnPlayer

--

Więcej informacji znajdziesz w Wikipedii MTA:

createColCuboid


Więcej informacji znajdziesz w Wikipedii MTA:

getElementsWithinColShape


Więcej informacji znajdziesz w Wikipedii MTA:

spawnPlayer


Postaw piwo autorowi tego posta
 

 
Tagi: respawn :: śmierci
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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