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

Wysłany: 2017-08-03, 10:41


Flash.

---






Wiek: 26
Na forum: 3255 dni
Posty: 93
Nick w MP: ------

Piwa: 2

Respekt: 50

Witajcie. Ot?? mam taki problem ?e ten kod mi nie dzia?a, kod na tp do Interioru.

http://wklej.org/id/3228578/

Je?li jest co? ?le prosz? o poprawk? i mete.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 11:17


TheKacperShow







Wiek: 24
Na forum: 3235 dni
Posty: 10
Nick w MP: LeqiT

Piwa: 1

Respekt: 50

co? w debugscript wychodzi ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 11:19


Flash.

---






Wiek: 26
Na forum: 3255 dni
Posty: 93
Nick w MP: ------

Piwa: 2

Respekt: 50

Skrypt znalaz?em ale nie dzia?a. Ja zielony w LUA xD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 11:21


TheKacperShow







Wiek: 24
Na forum: 3235 dni
Posty: 10
Nick w MP: LeqiT

Piwa: 1

Respekt: 50

masz do tego plik meta.xml ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 11:25


TheKacperShow







Wiek: 24
Na forum: 3235 dni
Posty: 10
Nick w MP: LeqiT

Piwa: 1

Respekt: 50

NyAngel, Polecam to usun??
Pomagamy tylko na forum

[ Dodano: 2017-08-03, 11:27 ]
stw?rz sobie folder o nazwie
interior

i do tego plik meta.xml

tam wpisz to:
Kod:


<meta>
<script src="interior.lua"/>
</meta>


i stw?rz jeszcze w tym folderze plik
interior.lua

a w nim wpisz to:
Kod:

wejscie1 = createMarker ( -1605.47, 711.93, 13.87, "arrow", 1.2, 255, 255, 0, 255 ) --tworzymy wejscie
wyjscie1 = createMarker ( -230.58, 1172.47, 57.26, "arrow", 1.2, 255, 255, 0, 255 ) --tworzymy wyjscie

function onstart()
setElementInterior ( wyjscie0, 1 ) --interior, w ktorym jest wyjscie
end
addEventHandler ( "onResourceStart", getRootElement(), onstart )

function warptopoli( hitElement, matchingDimension )

if getElementType(hitElement) == "player" then
if not isPedInVehicle ( hitElement ) then
setElementPosition ( hitElement, -230.58, 1172.47, 57.26) --kiedy wejdziemy w marker wejscia, ma nas teleportowac do miejsca, ktore jest tutaj podane
setElementInterior ( hitElement, 1 ) --te miejsce jest w interiorze 1 (w tym przypadku)
end
end
end
addEventHandler( "onMarkerHit", wejscie1, warptopoli)

function warptokgp(source)
setElementInterior ( source, 1 ) --te miejsce jest w interiorze 1 (w tym przypadku)
setElementPosition ( source, -1605.47, 711.93, 13.87) --kiedy wejdziemy w marker wyjscia, ma nas teleportowac do miejsca, ktore jest tutaj podane
end
addEventHandler( "onMarkerHit", wyjscie0, warptokgp)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 12:09


Flash.

---






Wiek: 26
Na forum: 3255 dni
Posty: 93
Nick w MP: ------

Piwa: 2

Respekt: 50

Prosz? o spok?j heh.

Co do skryptu to nie dzia?a. Jest meta, jest plik .lua a w nim kod.

wejscie1 createMarker 2495.36499 -1691.13867 14.76563"arrow"1.22552550255 )
wyjscie1 createMarker 2412.23584 -1685.91150 54.14884"arrow"1.22552550255 ) 

function onstart() 
setElementInterior wyjscie0)
end 
addEventHandler "onResourceStart"getRootElement(), onstart ) 

function warptopolihitElementmatchingDimension ) 

if getElementType(hitElement) == "player" then 
if not isPedInVehicle hitElement then 
setElementPosition hitElement2412.32861 -1688.58911 54.14884setElementInterior hitElement)
end 
end 
end 
addEventHandler"onMarkerHit"wejscie1warptopoli) 

function warptokgp(sourcesetElementInterior source)
setElementPosition source2495.31958 -1687.92957 13.51638)
end 
addEventHandler"onMarkerHit"wyjscie0warptokgp)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 12:11


TheKacperShow







Wiek: 24
Na forum: 3235 dni
Posty: 10
Nick w MP: LeqiT

Piwa: 1

Respekt: 50

tete ustawi?e? takj? jak? ci poda?em czy mia?e? ju? inn??
zaloguj si? na serwerze i wpisz
/debugscript 3

i to co ci wyjdzie na czerwono na dole
napisz tutaj

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 12:13


NyAngel







Wiek: 22
Na forum: 3950 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8

wejscie1 createMarker 2495.36499 ,-1691.1386714.76563"arrow"1.22552550255 )
wyjscie1 createMarker 2412.23584, -1685.9115054.14884"arrow"1.22552550255 ) 

function onstart() 
setElementInterior wyjscie0)
end 
addEventHandler "onResourceStart"getRootElement(), onstart ) 

function warptopolihitElementmatchingDimension ) 

if getElementType(hitElement) == "player" then 
if not isPedInVehicle hitElement then 
setElementPosition hitElement2412.32861 ,-1688.5891154.14884setElementInterior hitElement)
end 
end 
end 
addEventHandler"onMarkerHit"wejscie1warptopoli) 

function warptokgp(sourcesetElementInterior source)
setElementPosition source2495.31958 ,-1687.9295713.51638)
end 
addEventHandler"onMarkerHit"wyjscie0warptokgp)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 12:27


NyAngel







Wiek: 22
Na forum: 3950 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8

 createBlip 2495.36499 ,-1691.1386714.765630,2,0,255,0255,099999wejscie1 createMarker 2495.36499 ,-1691.1386714.76563"arrow"1.22552550255 )
wyjscie1 createMarker 2412.23584, -1685.9115054.14884"arrow"1.22552550255 ) 

function onstart() 
setElementInterior wyjscie1)
end 
addEventHandler "onResourceStart"getRootElement(), onstart ) 

function warptopolihitElementmatchingDimension ) 

if getElementType(hitElement) == "player" then 
if not isPedInVehicle hitElement then 
setElementPosition hitElement289.7870 ,-35.7190,1003.5160setElementInterior hitElement)
end 
end 
end 
addEventHandler"onMarkerHit"wejscie1warptopoli) 

function warptokgp(sourcesetElementInterior source)
setElementPosition source2495.31958 ,-1687.9295713.51638)
end 
addEventHandler"onMarkerHit"wyjscie1warptokgp)



dzia?a w 100% , doda?em blip bo chcia??m sprawdzi? gdzie to ma by?.

[ Dodano: 2017-08-03, 12:33 ]
createBlip 2495.36499 ,-1691.1386714.765630,2,0,255,0255,099999wejscie1 createMarker 2495.36499 ,-1691.1386714.76563"arrow"1.22552550255 )
wyjscie1 createMarker (285.46619, -40.921701001.51563"arrow"1.22552550255 ) 

function onstart() 
setElementInterior wyjscie1)
end 
addEventHandler "onResourceStart"getRootElement(), onstart ) 

function warptopolihitElementmatchingDimension ) 





if getElementType(hitElement) == "player" then 
if not isPedInVehicle hitElement then 
setElementPosition hitElement289.7870 ,-35.7190,1003.5160setElementInterior hitElement)
end 
end 
end 
addEventHandler"onMarkerHit"wejscie1warptopoli) 

function warptokgp(sourcesetElementInterior source)
setElementPosition source,2493.54688, -1684.5878913.51007)
end 
addEventHandler"onMarkerHit"wyjscie1warptokgp)



sorry wtedy nei da?em wyj?cia

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 12:50


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Masz tu np. pod gui :)


Server:

  addEvent("tp1"true)
addEventHandler("tp1"root, function()
        setElementPosition(sourcex,y,z)
    setElementInterior(source,ID)
    setElementDimension(sourceID)
end
)

  addEvent("tp2"true)
addEventHandler("tp2"root, function()
        setElementPosition(sourcexy,z)
            setElementInterior(sourceID)
    setElementDimension(source,ID)
end
)




C


Marker =  {}
Marker[1] = createMarker(x,y,z"cylinder"12551850)
Marker[2] = createMarker(xyz"cylinder"125518500)

    setElementInterior(Marker[1],10)
    setElementDimension(Marker[1], 1)

function tp1c()
if source ~= GUIEditor.button[1then return end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
    triggerServerEvent("tp1"localPlayer)
        end
        
addEventHandler "onClientGUIClick"roottp1c)



function tp2c()
if source ~= GUIEditor.button[2then return end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
    triggerServerEvent("tp2"localPlayer)
        end
        
addEventHandler "onClientGUIClick"roottp2c)


Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 14:37


Flash.

---






Wiek: 26
Na forum: 3255 dni
Posty: 93
Nick w MP: ------

Piwa: 2

Respekt: 50

Graczu NyAngel - Dzia?a :) Jedynie chc? si? spyta? jak doda? interior do domku z map edytora?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 14:44


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Flash.,

Jak zapisujesz map? w MAPEDYTOR np. "parking-LS"

To odpalasz serwer i wpisujesz "start parking-LS"

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 14:50


NyAngel







Wiek: 22
Na forum: 3950 dni
Posty: 128
Nick w MP: NyAngel

Piwa: 556

Respekt: 86,8

Flash,b?dziesz musia? wpisa? kordy... czyli, od wej?cia,?e wchodzi i teleportuje ci? i kordy musisz poda? gdzie ma tepn?? i potem jak chcesz wyj?? to te? kordy gdzie wyj?cie i jak si? wejdzie to gdzie ma tepn?? ;p

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 15:24


Flash.

---






Wiek: 26
Na forum: 3255 dni
Posty: 93
Nick w MP: ------

Piwa: 2

Respekt: 50

To mo?e ja potem dodam tu kordy i ty mi zrobisz kod z nimi? Bo jak ja robi? to nie wychodzi.

[ Dodano: 2017-08-03, 16:16 ]
Wej?cie do interioru = 1727.00061 -1636.77026 20.21726
Miejsce w kt?re tepa po wej?ciu w marker wej?cia = 2412.19116 -1689.25647 54.14884
Wyj?cie z interioru = 2412.38965 -1685.49182 54.14884
Miejsce gdzie tepa po wej?ciu w markej wyj?cia = 1727.21838 -1634.17554 20.21600

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-03, 19:59


venzikk

LUA, MODELER






Wiek: 24
Na forum: 3823 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240


createBlip 2495.36499 ,-1691.1386714.765630,2,0,255,0255,099999wejscie1 createMarker (  1727.00061, -1636.7702620.21726 "arrow"1.22552550255 )
wyjscie1 createMarker (2412.38965, -1685.4918254.14884 "arrow"1.22552550255 ) 

function onstart() 
setElementInterior wyjscie1)
end 
addEventHandler "onResourceStart"getRootElement(), onstart ) 

function warptopolihitElementmatchingDimension ) 





if getElementType(hitElement) == "player" then 
if not isPedInVehicle hitElement then 
setElementPosition hitElement2412.19116, -1689.2564754.14884setElementInterior hitElement)
end 
end 
end 
addEventHandler"onMarkerHit"wejscie1warptopoli) 

function warptokgp(sourcesetElementInterior source)
setElementPosition source,1727.21838, -1634.1755420.21600)
end 
addEventHandler"onMarkerHit"wyjscie1warptokgp)



Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Tagi: niedziałający :: kod :: teleport :: interioru.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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