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

Wysłany: 2015-07-13, 14:02


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Witam chcia?bym aby tepa?o gracza w dane miejsce a pozycje markera i gdzie ma tepac gracza odczytywa?o z tabeli. Pr?bowa?em na r?zne sposobny ale sobie nie poradzi?em. Kod:


local markery={
--x,y,z markera, dimension markera, interior markera, x,y,z,rz pozycja i rotacja tepnietego gracza, dimension tepnietego gracza, interior tepnietego gracza
{1486.92749, -1740.11792, 13.54688+0.5,0,2, 1494.25403, -1740.18872, 13.54688,0, 0,1}
}

for i,v in ipairs(markery) do
        markery[i]=createMarker(v[1],v[2],v[3], "arrow",1)
        setElementInterior(markery[i], v[4])
        setElementDimension(markery[i], v[5])
    end


Co z tym zrobic aby odczyta?o w jaki marker wszed? gracz i tepne?o w podan? pozycje? Za pomoc stawiam :arrow: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 14:14


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

pos = {
{x, y, z, int, dim, x2, y2, z2},
}

for k, v in ipairs(pos) do
marker = createMarker(v[1], v[2], v[3], "arrow", 1.0, 255, 0, 0, 130)
setElementInterior(marker, v[4])
setElementDimension(marker, v[5])

function tp(he, md)
if he ~= localPlayer then return end
if not md then return end
setElementPosition(he, v[6], v[7], v[8])
end
addEventHandler("onClientMarkerHit", root, tp)

sprobuj tak



Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 14:39


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Dzi?a tylko wtedy gdy jest stworzy jeden marker gdy stworzy sie drugi(doda w tabeli) to tepa z obu do tego samego miejsca.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:06


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

a zamie? root na marker

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:11


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Teraz wgl nie tepa.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:15


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

pos = {
{x, y, z, int, dim, x2, y2, z2},
}

for k, v in ipairs(pos) do
v.marker = createMarker(v[1], v[2], v[3], "arrow", 1.0, 255, 0, 0, 130)
setElementInterior(marker, v[4])
setElementDimension(marker, v[5])

function tp(he, md)
if he ~= localPlayer then return end
if not md then return end
setElementPosition(he, v[6], v[7], v[8])
end
addEventHandler("onClientMarkerHit", root, tp)





SProbuj teraz

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:22


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Zn?w tepa w te same miejsca.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:48


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

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

piotr172, dajesz tu skrawek wyci?tego kodu, clienta z mojego serwera(.actionGaming).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 15:56


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

"Maximerr" napisał/a:

piotr172, dajesz tu skrawek wyci?tego kodu, clienta z mojego serwera(.actionGaming).


Ja daje? Przecie? ten kod co ja da?em sam napisa?em, ka?dy takie cos mo?e napisa?. Na pewno to by?o do mnie? Ja nawet nie gra?em na tym serwerze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 16:23


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

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

piotr172, @OFFTopic, hm, mo?e Ci? pomyli?em - przepraszam, po prostu u?ytkownik o podobnym nicku(Piotreg czy tam Piotrq) podkrada? mi strony clienta z serwera, przepraszam r?wnie? za offtopic.

[ Dodano: 2015-07-13, 16:26 ]
piotr172, @Topic,
pos = {
{x, y, z, int, dim, x2, y2, z2},
}

for _, v in ipairs(pos) do
marker = createMarker(v[1], v[2], v[3], "arrow", 1.0, 255, 0, 0, 130)
setElementInterior(marker, v[4])
setElementDimension(marker, v[5])
setElementData ( marker, "posX", v[6] )
setElementData ( marker, "posY", v[7] )
setElementData ( marker, "posZ", v[8] )
end

function tp(he, md)
if he ~= localPlayer then return end
if not md then return end
if getElementData ( source, "posX" ) then
local x = getElementData ( source, "posX" )
local y = getElementData ( source, "posY" )
local z = getElementData ( source, "posZ" )

setElementPosition(he, x,y,z)
end
end
addEventHandler("onClientMarkerHit", root, tp)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-13, 16:30


piotr172







Wiek: 27
Na forum: 4558 dni
Posty: 130

Piwa: 2329

Respekt: 105,3
Respekt: 105,3

Spoko, nic si? nie sta?o. Dzi?ki za kod bo dzia?a. Do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: tepanie :: gracza
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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