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: 32
Na forum: 4122 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( -19, 1178, 20, 'cylinder', 2.0, 255, 0, 0, 150)

function fele ( player, commandName, id, hitElement, matchingDimension )
if isPedInVehicle ( player ) then
            local elementType = getElementType( hitElement )
            local id = tonumber ( id )
            local theVehicle = getPedOccupiedVehicle ( player )
            local success = addVehicleUpgrade ( theVehicle, 1073 )
            local currentFreezeStatus = isElementFrozen ( theVehicle )
            setElementFrozen ( theVehicle, true )
        end
    end
addEventHandler( "onMarkerHit", myMarker, fele )

function stop ( thePlayer, playerVehicle )
    if isPedInVehicle ( thePlayer ) then
            local playerVehicle = getPedOccupiedVehicle ( thePlayer )
            local currentFreezeStatus = isElementFrozen ( playerVehicle )
            local newFreezeStatus = not currentFreezeStatus
            setElementFrozen ( playerVehicle, false )
        end
end
addCommandHandler ( "stop", stop )


Postaw piwo autorowi tego posta
 

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


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

Drugi argument w addCommandHandler server-side to komenda.
function stop ( thePlayer, command )


Postaw piwo autorowi tego posta
 

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


timmer1994

Recon






Wiek: 32
Na forum: 4122 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: 4568 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 ( auto, false )
        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