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

Wysłany: 2014-10-09, 15:46


VistoR







Wiek: 27
Na forum: 4811 dni
Posty: 11
Nick w MP: VistoR

Piwa: 1

Respekt: 50

Mam tu taki kod i chcia?bym sie przenie?? do interioru "2" (tylko gracz bez auta). A i jeszcze nie dziala :C

Kod:

marker = createMarker(390, 173.7001953125, 1006.700012207, "type", r, g, b, a)

function teleport(player)
if getElementType(player)=="player" then
local vehicle=getPedOccupiedVehicle(player)
if source == marker then
setElementPosition(vehicle, -2719.2998046875, -319.2001953125, 6.1999998092651)
setElementFrozen(vehicle, true)
setTimer(setElementFrozen, 1000, 1, vehicle, false)
end
end
end
addEventHandler("onClientMarkerHit", getRootElement(), teleport)


Daje piwko za pomoc :piwo:

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
typekelo
Wysłany: 2014-10-09, 16:34


Artysta

Lua, Lua, Czekolada






Wiek: 28
Na forum: 4466 dni
Posty: 240
Nick w MP: Artysta/Koojot

Piwa: 1427

Respekt: 205,8
Respekt: 205,8Respekt: 205,8


Więcej informacji znajdziesz w Wikipedii MTA:

setElementInterior


Podpis
Something is coming..
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-09, 16:55


VistoR







Wiek: 27
Na forum: 4811 dni
Posty: 11
Nick w MP: VistoR

Piwa: 1

Respekt: 50

Dam piwo, ale prosi? bym o gotowy kod. Bo nie dziala :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-09, 18:51


Artysta

Lua, Lua, Czekolada






Wiek: 28
Na forum: 4466 dni
Posty: 240
Nick w MP: Artysta/Koojot

Piwa: 1427

Respekt: 205,8
Respekt: 205,8Respekt: 205,8

S?uchaj, masz

local vehicle=getPedOccupiedVehicle(player

Definiuje to, pojazd gracza.

Po tym dodaj argument, ?e gracz nie mo?e by? w poje?dzie, czyli
if not vehicle then 


Zamie? to teraz "vehicle" na obiekt, kt?ry ma przenosi? i freezowa?, czyli player
setElementPosition(vehicle, -2719.2998046875, -319.20019531256.1999998092651setElementFrozen(vehicletruesetTimer(setElementFrozen10001vehiclefalse


Ostatni? rzecz? b?dzie policzenie "if", do tylu ile ich jest dodaj 1 i wpisz tyle razy end na ko?cu skryptu.

Aaaa i dodaj to setElementInterior :)

Podpis
Something is coming..
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-09, 20:04


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

marker createMarker(390173.70019531251006.700012207"type"rgba)?

function teleport(player)?
if getElementType(player)=="player" then?
local vehicle=getPedOccupiedVehicle(player)
if not vehicle then 
if source == marker then?
setElementPosition(player, -2719.2998046875, -319.20019531256.1999998092651)?
setElementFrozen(playertrue)?
setElementInterior(playerID interioru)
setTimer(setElementFrozen10001playerfalse)?
end?
end?
end
end?
addEventHandler("onClientMarkerHit"getRootElement(), teleport)?


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-09, 20:08


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Maximerr, hmm troche innaczej zrobic mo?na :D
marker createMarker(390173.70019531251006.700012207"type"rgba) 

function teleport(player) 
if getElementType(player)=="player" then 
local vehicle=getPedOccupiedVehicle(player)
if not vehicle then 
setElementPosition(player, -2719.2998046875, -319.20019531256.1999998092651setElementFrozen(playertruesetElementInterior(playerID interioru)
setTimer(setElementFrozen10001playerfalseend 
end
end 
addEventHandler("onClientMarkerHit"marker teleport


Postaw piwo autorowi tego posta
 

 
Tagi: 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 » Teleport do interioru 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