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

Wysłany: 2015-07-17, 19:46


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

Witam, stworzy?em marker, jesli sie w niego wiedzie to daje nam felgi.
Przy tym freezuje nam pojazd na czas kiedy jestesmy w markerze.
Chcialem zeby komend? "stop" odblokowa?o mi pojazd bym m?g? odjecha?, ale niestety komenda "stop" nie przynosi wefektu

local myMarker createMarker( -19117820'cylinder'2.025500150)

function fele playercommandNameidhitElementmatchingDimension )
if isPedInVehicle player then
            local elementType getElementTypehitElement )
            local id tonumber id )
            local theVehicle getPedOccupiedVehicle player )
            local success addVehicleUpgrade theVehicle1073 )
            local currentFreezeStatus isElementFrozen theVehicle )
            setElementFrozen theVehicletrue )
        end
    end
addEventHandler"onMarkerHit"myMarkerfele )

function stop thePlayerplayerVehicle )
    if isPedInVehicle thePlayer then
            local playerVehicle getPedOccupiedVehicle thePlayer )
            local currentFreezeStatus isElementFrozen playerVehicle )
            local newFreezeStatus not currentFreezeStatus
            setElementFrozen playerVehiclefalse )
        end
end
addCommandHandler "stop"stop )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-17, 19:55


Tostuch







Wiek: 27
Na forum: 4931 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

Drugi argument w addCommandHandler server-side to komenda.
function stop thePlayercommand )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-17, 20:42


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

Dalej jestem zablokowany, po wpisaniu "/stop"

Podpis
Uczę się tworzyć skrypty ;) Pomóż zielonemu.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-17, 21:03


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

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

function stop (plr,cmd)
    if isPedInVehicle plr then
            local auto getPedOccupiedVehicle plr )
        if isElementFrozen auto then
            setElementFrozen autofalse )
        end
   end
end
addCommandHandler "stop"stop )


Postaw piwo autorowi tego posta
 

 
Tagi: tuning :: marker :: komenda
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