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

Wysłany: 2013-03-06, 15:59


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

B??d z createMarker

xyunpack(tMarker)
marker createMarker(xyz"cylinder"200255255)


Ostatnio zmieniony przez vipSEBOvip 2013-03-06, 16:12, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-06, 16:01


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

vipSEBOvip, b??d z createObject a pokazujesz kod z createMarker? Poka? tablic? tMarker.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-06, 16:11


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Pomyli?em si? pisz?c nazwe i opis xD. Poprawione

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-07, 07:53


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Kod:

tMarker={
{100,100,20},
{440,1440,24}

}
marker = createMarker(tMarker[1][1], tMarker[1][2], tMarker[1][3], "cylinder", 2, 0, 0, 255, 255)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-11, 13:49


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Tworzy si? tylko 1 marker z tabeli, a mi chodzi by si? tworzy?y wszystkie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-11, 16:02


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

tMarker={ 
{100,100,20}, 
{440,1440,24} 

} 

for i,v in pairs(tMarker) do
marker createMarker(v[1], v[2], v[3], "cylinder"200255255)
do


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 13:48


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Dzi?ki, masz :piwo: . Ale jeszcze jedno pytanie, podczepi?em to pod kod i nie aktywuje si?

local tAuta = { [413]=true, [482]=true }

addEventHandler("onMarkerHit"marker,
function(player)
    local veh getPedOccupiedVehicle(player)
    if veh then
        if (not tAuta[getElementModel(veh)]) then
            triggerClientEvent(player"onMarkerWeszed"getRootElement())
        end
    else
    outputChatBox("Musisz by? w poje?dzie !"player)
    end
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 15:16


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

Spr?buj tak:

local tAuta = { [413]=true, [482]=true }

addEventHandler("onMarkerHit"root,
function(hitElement)
    if isElement(hitElement) and source == marker then
        local veh getPedOccupiedVehicle(hitElement)
        if veh then
            if (not tAuta[getElementModel(veh)]) then
                triggerClientEvent(hitElement"onMarkerWeszed"getRootElement())
            end
        else
        outputChatBox("Musisz by? w poje?dzie!"hitElement)
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 17:25


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Wci?? si? nie pokazuje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 17:39


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

local tAuta = { [413]=true, [482]=true }

addEventHandler("onMarkerHit"root,
function(hitElement)
local veh getPedOccupiedVehicle(hitElement)
    if veh then
        if (not tAuta[getElementModel(veh)]) then
        triggerClientEvent(hitElement"onMarkerWeszed"getRootElement())
        end
    else
    outputChatBox("Musisz by? w poje?dzie!"hitElement)
    end
end)


Ten kod mi dzia?a?...Nie mo?esz by? w poje?dzie o ID podanych w tablicy.

PS. Ten kod b?dzie dzia?a? na ka?de wej?cie w dowolny marker - pasuje o tym pami?ta?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 18:02


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Oto cytat z debuga

WARING: script/server.lua:16: Bad 'ped' pointer @ 'getPedOccupiedVehicle'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 18:10


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

vipSEBOvip, dodaj warunek kt?ry sprawdza czy element kt?ry wchodzi w marker jest graczem(getElementType).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 18:21


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Czyli tak?

if (hitElement == getElementType("player"then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-12, 19:15


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360


if (getElementType(hitElement) == "player"then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-03-14, 16:45


vipSEBOvip

A poor begginer






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

Piwa: 77

Respekt: 140
Respekt: 140

Dzi?ki

Postaw piwo autorowi tego posta
 

 
Tagi: createmarker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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