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

Wysłany: 2016-12-29, 14:04


mtm

</3






Wiek: 26
Na forum: 3716 dni
Posty: 181

Piwa: 252

Respekt: 70

dzie? dobry, mam problem xd..
mo?e jest do?? prosty do rozwi?zania ale utkn??em kombinuj?c ju? ze wszystkim co mi wpad?o do g?owy...
za ka?dym razem mi to nie dzia?a, i wgl, sprawa prosta chce zablokowa? mo?liwo?? wej?cia albo zbugowania postaci po przez wjazd do markera pojazdem, r??ne cuda si? dziej? np wywala do limbo itd, to kod;


addEventHandler("onMarkerHit"getRootElement(),
    function(hitPlayermatchingDimension)
        if ( getElementData(source"weaponshop") ) then
            if isPedInVehicle(hitPlayerthen
                    -- // effect
                fadeCamera(hitPlayerfalse)
                setTimer(fadeCamera10001hitPlayertrue)
                    -- // entrance/exit
                if ( getElementData(source"entrance") ) then
                    setTimer(setElementInterior10001hitPlayer1)
                    setTimer(setElementPosition10001hitPlayergetElementData(source"x"), getElementData(source"y"), getElementData(source"z"))
                    setTimer(setElementRotation10001hitPlayer000)
                elseif ( getElementData(source"exit") ) then
                    setTimer(setElementInterior10001hitPlayer0)
                    setTimer(setElementPosition10001hitPlayergetElementData(source"x"), getElementData(source"y"), getElementData(source"z"))
                    setTimer(setElementRotation10001hitPlayer00180)
                end
                    -- // block dmg
                if ( getElementData(source"entrance") ) then
                    setPedWeaponSlot(hitPlayer0)
                    toggleControl(hitPlayer"fire"false)
                    toggleControl(hitPlayer"next_weapon"false)
                    toggleControl(hitPlayer"previous_weapon"false)
                    toggleControl(hitPlayer"aim_weapon"false)
                elseif ( getElementData(source"exit") ) then
                    setTimer(setPedWeaponSlot10001hitPlayer0)
                    setTimer(toggleControl10001hitPlayer"fire"true)
                    setTimer(toggleControl10001hitPlayer"next_weapon"true)
                    setTimer(toggleControl10001hitPlayer"previous_weapon"true)
                    setTimer(toggleControl10001hitPlayer"aim_weapon"true)
                else
                    outputDebugString("[restaurants.lua] problem with type 17rd variable in table restaurants_markers")
                end
            end
        end
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 14:14


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

addEventHandler("onMarkerHit"getRootElement(),
    function(hitPlayermatchingDimension)
        if ( getElementData(source"weaponshop") ) then
            if isPedInVehicle(hitPlayerthen return end
                    -- // effect
                fadeCamera(hitPlayerfalse)
                setTimer(fadeCamera10001hitPlayertrue)
                    -- // entrance/exit
                if ( getElementData(source"entrance") ) then
                    setTimer(setElementInterior10001hitPlayer1)
                    setTimer(setElementPosition10001hitPlayergetElementData(source"x"), getElementData(source"y"), getElementData(source"z"))
                    setTimer(setElementRotation10001hitPlayer000)
                elseif ( getElementData(source"exit") ) then
                    setTimer(setElementInterior10001hitPlayer0)
                    setTimer(setElementPosition10001hitPlayergetElementData(source"x"), getElementData(source"y"), getElementData(source"z"))
                    setTimer(setElementRotation10001hitPlayer00180)
                end
                    -- // block dmg
                if ( getElementData(source"entrance") ) then
                    setPedWeaponSlot(hitPlayer0)
                    toggleControl(hitPlayer"fire"false)
                    toggleControl(hitPlayer"next_weapon"false)
                    toggleControl(hitPlayer"previous_weapon"false)
                    toggleControl(hitPlayer"aim_weapon"false)
                elseif ( getElementData(source"exit") ) then
                    setTimer(setPedWeaponSlot10001hitPlayer0)
                    setTimer(toggleControl10001hitPlayer"fire"true)
                    setTimer(toggleControl10001hitPlayer"next_weapon"true)
                    setTimer(toggleControl10001hitPlayer"previous_weapon"true)
                    setTimer(toggleControl10001hitPlayer"aim_weapon"true)
                else
                    outputDebugString("[restaurants.lua] problem with type 17rd variable in table restaurants_markers")
              --  end
            end
        end
    end
)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 14:21


mtm

</3






Wiek: 26
Na forum: 3716 dni
Posty: 181

Piwa: 252

Respekt: 70

jednak?e sp?jrz, hitElement w czasie wjechania w marker jest pojazdem, r?wnie? wywala w za?wiaty..

[ Dodano: 2016-12-29, 14:23 ]
chyba ?e
if getElementType(hitPlayer) == "vehicle" then return end


[ Dodano: 2016-12-29, 14:24 ]
te? nie dzia?a, wywala w kosmos..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 15:16


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Spr?buj jeszcze


local veh getPedOccupiedVehicle(hitPlayer)
   if veh then return end


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 15:35


mtm

</3






Wiek: 26
Na forum: 3716 dni
Posty: 181

Piwa: 252

Respekt: 70

niestety to te? nie b?dzie dzia?a?, z tego powodu, ?e jak ma pobra? pojazd z pojazdu gracza ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 15:38


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

Jak pobra? pojazd pojazdu, ty chcesz aby dzia?a?o tylko gdy gracz wejdzie w marker a nie wjedzie - nie rozumiem ju? co chcesz zrobi?.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-29, 15:39


mtm

</3






Wiek: 26
Na forum: 3716 dni
Posty: 181

Piwa: 252

Respekt: 70

To Ty poda?e? kod do pobrania pojazdu
local veh = getPedOccupiedVehicle(hitPlayer)
o taki, przecie...

a hit Player w momencie gdy wjedziesz do markera jest elemeentem typu vehicle...

[ Dodano: 2016-12-29, 15:40 ]
wgl to jest jakie? dziwne, mo?e po stronie client by to lepiej dzia?a?o?

[ Dodano: 2016-12-29, 15:41 ]
a na marginesie, tak gdy wejdzie, to tepa jak wjedzie to nie tepa.

[ Dodano: 2016-12-29, 15:51 ]
dobra sprawa prosta, to trzeba zrobi? na stronie client

Postaw piwo autorowi tego posta
 

 
Tagi: blokada :: teleportacji :: pojazdu :: 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 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