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

Wysłany: 2017-12-28, 12:00


BartiCoderNoob







Wiek: 28
Na forum: 3080 dni
Posty: 11
Nick w MP: Barti



Respekt: 50

Mam ambicj? napisa? wszystkie misje z GTA SA na server MTA dla dw?ch os?b, ale nie za bardzo jeszcze umiem pisa? skrypty. R*
To co uda?o mi si? napisa?, to ?e po wej?ciu na server, pojawia si? rower [tam gdzie pierwsza misja w SA]. Teraz chcia?em ?eby do roweru by? doczepiony marker a po wej?ciu na rower, marker znikn??. Oto moje wypociny, kt?re absolutnie nie dzia?aj?.
M?g?by mi kto? co? podpowiedzie??

local x1y1z1rx1ry1rz1  2243.2, -1263.223.500270
function startBikes()
    local Bike createVehicle 48100) 
    setVehicleColorBike88,142,110 )
    spawnVehicleBikex1y1z1rx1ry1rz1)
    local spawnVeh spawnVehicle Bikex1y1z1rx1ry1rz1 )
end
addEventHandler "onPlayerJoin"getRootElement(), startBikes)

function createMarkerAttachedTo(elementmTypesizergbavisibleToxOffsetyOffsetzOffset)
    mTypesizergbavisibleToxOffsetyOffsetzOffset "arrow"0,500255255getRootElement(), 001
    assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]"assert(type(mType) == "string""Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]"assert(type(size) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]"assert(type(r) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]")    assert(type(g) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]"assert(type(b) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]"assert(type(a) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]"assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]"assert(type(xOffset) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]"assert(type(yOffset) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]"assert(type(zOffset) == "number""Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]")
    local m createMarker(000mTypesizergbavisibleTo)
    if m then if attachElements(melementthen return m end end return false
end
addEventHandler "onPlayerJoin"getRootElement(), createMarkerAttachedTo )

local Bike1 = { [481]=true }
function deleteMarker theVehicleseatjacked )
    local vehID getElemendModel Bike1 )
    if Bike1[vehIDthen
        outputChatBox "Go to the Grove Street!"source ) 
    end
end
addEventHandler "onPlayerEnterVehicle"getRootElement(), deleteMarker )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 13:49


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

Po 1. Pisz misje po client-side(z triggerowaniem do serverside by zsynchronizowa? dw?ch graczy)
Po 2.

Więcej informacji znajdziesz w Wikipedii MTA:

destroyElement


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 13:51


BartiCoderNoob







Wiek: 28
Na forum: 3080 dni
Posty: 11
Nick w MP: Barti



Respekt: 50

Czyta?em wiki, ale to wszystko co potrafi?em z niej wycisn??. Prze?o?? to na client-side, zobaczymy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 13:55


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"BartiCoderNoob" napisał/a:

Czyta?em wiki, ale to wszystko co potrafi?em z niej wycisn??. Prze?o?? to na client-side, zobaczymy

polecam ci robi? eventHandlery w taki spos?b



local x1y1z1rx1ry1rz1  2243.2, -1263.223.500270

addEventHandler "onPlayerJoin"getRootElement(),function() 
local Bike createVehicle 48100) 
    setVehicleColorBike88,142,110 )
    spawnVehicleBikex1y1z1rx1ry1rz1)
    local spawnVeh spawnVehicle Bikex1y1z1rx1ry1rz1 )
end)

Tak robi WI?KSZO?? os?b robi?cych skrypty, jest to wygodne i czytelne.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 17:35


BartiCoderNoob







Wiek: 28
Na forum: 3080 dni
Posty: 11
Nick w MP: Barti



Respekt: 50

Dobra, troch? przerobi?em, ale niszczenie markera nadal nie dzia?a:

local x1y1z1rx1ry1rz1  2243.2, -1263.223.500270 -- ustawiam koordynaty spawnu pojazdu

addEventHandler "onPlayerJoin"getRootElement(),function() 
    local Bike createVehicle 48100) -- ustawiam rodzaj pojazdu
    setVehicleColorBike88,142,110 ) -- ustawiam kolor
    spawnVehicleBikex1y1z1rx1ry1rz1)
    local spawnVeh spawnVehicle Bikex1y1z1rx1ry1rz1 ) -- spawnuje pojazd
        local xb1yb1zb1 getElementPosition Bike ) -- biorkoordynaty pojazdu
        local theMarker createMarker xb1yb1zb1"arrow"0.42552550170 ) -- tworznad pojazdem marker
        attachElements theMarkerBike001.5 ) -- kt?ry jest do niego przyczepiony
        local driver getVehicleOccupant Bike ) -- chcia?em odczytaczy na rowerze ktosiedzi
        if (driverthen -- i je?li siedzi
            destroyElement(element theMarker)  -- to zniszczymarker
        end
        
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 19:04


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4556 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"BartiCoderNoob" napisał/a:

Dobra, troch? przerobi?em, ale niszczenie markera nadal nie dzia?a:

local x1y1z1rx1ry1rz1  2243.2, -1263.223.500270 -- ustawiam koordynaty spawnu pojazdu

addEventHandler "onPlayerJoin"getRootElement(),function() 
    local Bike createVehicle 48100) -- ustawiam rodzaj pojazdu
    setVehicleColorBike88,142,110 ) -- ustawiam kolor
    spawnVehicleBikex1y1z1rx1ry1rz1)
    local spawnVeh spawnVehicle Bikex1y1z1rx1ry1rz1 ) -- spawnuje pojazd
        local xb1yb1zb1 getElementPosition Bike ) -- biorkoordynaty pojazdu
        local theMarker createMarker xb1yb1zb1"arrow"0.42552550170 ) -- tworznad pojazdem marker
        attachElements theMarkerBike001.5 ) -- kt?ry jest do niego przyczepiony
        local driver getVehicleOccupant Bike ) -- chcia?em odczytaczy na rowerze ktosiedzi
        if (driverthen -- i je?li siedzi
            destroyElement(element theMarker)  -- to zniszczymarker
        end
        
end)

destroyElement(theMarker) -- to zniszczy? marker
polecam ci nazywa? markery wed?ug tego co robi? itd.
czyli np marker nad rowerem to by?by
local mrower

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-12-28, 22:54


BartiCoderNoob







Wiek: 28
Na forum: 3080 dni
Posty: 11
Nick w MP: Barti



Respekt: 50

MAM TO!!!

local x1y1z1rx1ry1rz1  2243.2, -1263.223.500270

addEventHandler "onPlayerJoin"getRootElement(),
    function() 
        getElementPositionsourcex1y1z1 )
        Bike createVehicle 48100)
        setVehicleColorBike88,142,110 )
        spawnVehicleBikex1y1z1rx1ry1rz1)
    local spawnVeh spawnVehicle Bikex1y1z1rx1ry1rz1 )
        local xb1yb1zb1 getElementPosition Bike )
        mBike1 createMarker xb1yb1zb1"arrow"0.42552550170 )
        attachElements mBike1Bike001.5 )
        local driver getVehicleOccupant (Bike)
        
    end)
    
addEventHandler("onVehicleEnter"root,
    function ( player )
        if ( source == Bike then 
            destroyElementmBike1 )
        end
    end)


Postaw piwo autorowi tego posta
 

 
Tagi: niszczenie :: markerka :: wejściu :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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