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

Wysłany: 2013-06-20, 14:35


VerTez

Amator Lua :/






Wiek: 31
Na forum: 4908 dni
Posty: 15
Nick w MP: VerTez

Piwa: 7

Respekt: 50

Chcia?bym napisa? skrypt na marker kt?ry teleportuje do danego pomieszczenia i ?eby nad tym markerem by? napis np Ammunation 24/7

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-20, 14:57


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

1. Tworzysz marker za pomoc? createMarker
2. U?ywasz eventu onMarkerHit
3. Teleportujesz gracza do danego miejsca za pomoc? setElementPosition i do danego interioru setElementInterior.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-20, 15:24


VerTez

Amator Lua :/






Wiek: 31
Na forum: 4908 dni
Posty: 15
Nick w MP: VerTez

Piwa: 7

Respekt: 50

podalbys skype ? mam wiecej pytan

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-20, 15:40


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

Ja na wszystkie pytania nie znam odpowiedzi :D

PS
Jak co? m?j skype to psssss. pw mamy.

Ostatnio zmieniony przez Riot 2013-06-21, 17:33, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-20, 22:20


VerTez

Amator Lua :/






Wiek: 31
Na forum: 4908 dni
Posty: 15
Nick w MP: VerTez

Piwa: 7

Respekt: 50

I dupaa .. ;C Nie dzia?a o to kod :

Kod:

lokalnych myMarker = createMarker ( 1368.5999755859, -1279.8000488281, 13.199999809265 , "arrow" , 2.0 , 255 , 0 , 0 , 150 ), - tworzenie myMarker

Funkcja MarkerHit ( hitElement, matchingDimension ) - okre?lenie MarkerHit funkcji do obs?ugi
lokalnych elementType = getElementType ( hitElement ) - uzyska? przebojowej elementu typ
outputChatBox ( elementType .. "wewn?trz myMarker" , getRootElement ( ) , 255 , 255 , 0 ) - - do??czy? typ elementu z tekstem, i wyj?cie to
koniec
addEventHandler ( "myMarker" , setElementPosition, setElementInterior ) - do??czy? onMarkerHit zdarzenie MarkerHit funkcji


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-21, 13:28


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

local myMarker createMarker(1368.5999755859, -1279.800048828113.199999809265 "arrow" 2.0 255 150) - tworzenie myMarker

function markerHit(hitElementmatchingDimension)
local elementType getElementType(hitElement)
outputChatBox (elementType .. " jest wewn?trz myMarker"hitElement2552550)
end
addEventHandler "onMarkerHit" myMarkermarkerHit)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-21, 19:47


Tey







Wiek: 31
Na forum: 4876 dni
Posty: 155
Nick w MP: l0nger

Piwa: 280

Respekt: 193
Respekt: 193Respekt: 193


local g_myMarker createMarker(xyz"corona"sizergba) -- x,y,z,size,r,g,b,zamienic na wlasne wartosci

addEventHandler("onClientMarkerHit"getRootElement(),
    function(player)
        if source == g_myMarker then
            -- teleportujemy tylko graczaw razie teleportacji z pojazdem uzyc getPedOccupiedVehicle(playerjako vehicle i teleportowac
            setElementPosition(playerto_xto_yto_z) -- tutaj tez zamienic na wlasna wartosc
            setElementFrozen(playertrue)
            setTimer(setElementFrozen10001playerfalse)
        end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-21, 19:59


VerTez

Amator Lua :/






Wiek: 31
Na forum: 4908 dni
Posty: 15
Nick w MP: VerTez

Piwa: 7

Respekt: 50

Niby dzia?a . . . Ale nie teleportuje gracza do interioru. I jeszcze jak zrobi? ?eby nad tym by? napis np Ammunation ? :< :D :D

KOD :

Kod:

local g_myMarker = createMarker(1368.5999755859, -1279.8000488281, 13.199999809265, "arrow", size, r, g, b, a) -- x,y,z,size,r,g,b,a - zamienic na wlasne wartosci

addEventHandler("onClientMarkerHit", getRootElement(),
function(player)
if source == g_myMarker then
-- teleportujemy tylko gracza, w razie teleportacji z pojazdem uzyc getPedOccupiedVehicle(player) jako vehicle i teleportowac
setElementPosition(player, to_x, to_y, to_z) -- tutaj tez zamienic na wlasna wartosc
setElementFrozen(player, true)
setTimer(setElementFrozen, 1000, 1, player, false)
end
end)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-21, 20:08


Tey







Wiek: 31
Na forum: 4876 dni
Posty: 155
Nick w MP: l0nger

Piwa: 280

Respekt: 193
Respekt: 193Respekt: 193

Co do interioru, zobacz to:
Kod:


addEventHandler("onClientMarkerHit", getRootElement(),
function(player)
if source == g_myMarker then
-- teleportujemy tylko gracza, w razie teleportacji z pojazdem uzyc getPedOccupiedVehicle(player) jako vehicle i teleportowac
local m_interior = getElementInterior(g_myMarker)

setElementPosition(player, to_x, to_y, to_z) -- tutaj tez zamienic na wlasna wartosc
setElementFrozen(player, true)
setTimer(setElementFrozen, 1000, 1, player, false)
if m_interior >= 0 then
setElementInterior(player, m_interior)
end
end
end)

Co do napisu, tutaj masz potrzebne funkcje do oskryptowania:
https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition
https://wiki.multitheftauto.com/wiki/GetElementPosition
https://wiki.multitheftauto.com/wiki/DxDrawText

Dodam, ze musisz to zaprogramowac w onClientRender.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-06-21, 21:37


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

VerTez, po kt?rej stronie kod umieszczasz ? Serwera czy clienta ?

Postaw piwo autorowi tego posta
 

 
Tagi: marker :: teleportacja
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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