Wysłany: 2021-05-03, 00:28
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3987 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Witam.
Dlaczego mi nic nie usuwa po od?o?eniu paczki?
function magazynierpraca ( button )
if button == "left" then
guiSetVisible ( guimagazynier , false )
guiSetVisible ( guilabel , false )
showCursor ( false )
outputChatBox ( "#a4c639Zanie? #a4c639paczk? #a4c639do #a4c639wyznaczonego #a4c639miejsca!" , 255 , 255 , 255 , true )
skrzyneczka = createObject ( 2912 , 0 , 0 , 0 , 0 , 0 , 0 , true )
attachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
setPedAnimation ( localPlayer , "CARRY" , "crry_prtial" , 1 , true )
toggleControl ( "sprint" , false , localPlayer )
toggleControl ( "jump" , false , localPlayer )
toggleControl ( "fire" , false )
setElementData ( localPlayer , "skrzynkaposiadana" , true )
local losowanie = math . random ( 2 , #magazynlokacje)
local cel = createMarker ( magazynlokacje [ losowanie ][ 1 ], magazynlokacje [ losowanie ][ 2 ], magazynlokacje [ losowanie ][ 3 ]- 1.0 , "cylinder" , 1.0 , 255 , 0 , 0 )
local blipcel = createBlipAttachedTo ( cel , 12 )
addEventHandler ( "onClientMarkerHit" , cel , magazynierkoniec )
end
end
function magazynierkoniec ( hitElement , matchingDimension )
if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) then
setElementData ( localPlayer , "skrzynkaposiadana" , false )
outputChatBox ( "#00B7FFOdk?adasz #00B7FFpaczk?, #00B7FFpoczekaj #00B7FFchwil?!" , 255 , 255 , 255 , true )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
toggleControl ( "fire" , true )
detachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
destroyElement ( skrzyneczka )
destroyElement ( cel )
destroyElement ( blipcel )
setPedAnimation ( localPlayer )
Wysłany: 2021-05-03, 01:40
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Wysłany: 2021-05-03, 12:02
xyzzz^
A nic
Wiek: 18 Na forum: 1993 dni Posty: 319
Nick w MP: Aspyk21
Piwa : 308
Wyprintuj sobie co? po tym destroyElement i zobacz czy kod tam dochodzi
Wysłany: 2021-05-03, 17:02
Norbert1234
Nie umiem w LUA
Wiek: 22 Na forum: 3987 dni Posty: 319
Nick w MP: Gusterowskyy
Piwa : 242
Wysłany: 2021-05-03, 17:41
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Element nieznany, spr?buj tego : (kod da?e? uciety wiec wez to pod uwage przy podmianie)
Kod: skrzyneczka={}
function magazynierpraca ( button )
if button == "left" then
guiSetVisible (guimagazynier, false )
guiSetVisible (guilabel, false )
showCursor ( false )
outputChatBox("#a4c639Zanie? #a4c639paczk? #a4c639do #a4c639wyznaczonego #a4c639miejsca!", 255, 255, 255, true)
skrzyneczka[localPlayer] = createObject (2912, 0, 0, 0, 0, 0, 0, true)
attachElements ( skrzyneczka[localPlayer], localPlayer, 0, 0.75, 0, 0, 0, 0 )
setPedAnimation ( localPlayer, "CARRY", "crry_prtial", 1,true )
toggleControl( "sprint", false, localPlayer)
toggleControl( "jump", false, localPlayer)
toggleControl( "fire", false)
setElementData (localPlayer, "skrzynkaposiadana", true)
local losowanie = math.random(2, #magazynlokacje)
local cel = createMarker(magazynlokacje[losowanie][1], magazynlokacje[losowanie][2], magazynlokacje[losowanie][3]-1.0, "cylinder", 1.0, 255, 0, 0)
local blipcel = createBlipAttachedTo(cel, 12)
addEventHandler("onClientMarkerHit", cel, magazynierkoniec )
end
end
function magazynierkoniec (hitElement, matchingDimension)
if getElementType( hitElement ) == "player" and not isPedInVehicle(hitElement) then
setElementData(hitElement, "skrzynkaposiadana", false)
outputChatBox("#00B7FFOdk?adasz #00B7FFpaczk?, #00B7FFpoczekaj #00B7FFchwil?!", 255, 255, 255, true )
toggleControl( "sprint", true)
toggleControl( "jump", true)
toggleControl( "fire", true)
detachElements ( skrzyneczka[hitElement], localPlayer, 0, 0.75, 0, 0, 0, 0 )
destroyElement ( skrzyneczka[hitElement])
destroyElement ( cel )
destroyElement ( blipcel )
setPedAnimation (hitElement)
Wysłany: 2021-05-03, 17:49
0nly6
Support-Team
Wiek: 23 Na forum: 2437 dni Posty: 54
Nick w MP: duhack
Piwa : 1040
Kompletnie nic ci nie usuwa? obiektu, markera, blipa ?
Wysłany: 2021-05-04, 08:01
Szyszka947
ASP NET Core / Lua
Wiek: 19 Na forum: 2579 dni Posty: 288
Piwa : 16
Nie wiem jak to jest w lua, ale zazwyczaj zmienna w funkcji nie wychodzi poza funkcj?. Spr?buj:
skrzyneczka = nil
cel = nil
blipcel = nil
function magazynierpraca ( button )
if button == "left" then
guiSetVisible ( guimagazynier , false )
guiSetVisible ( guilabel , false )
showCursor ( false )
outputChatBox ( "#a4c639Zanie? #a4c639paczk? #a4c639do #a4c639wyznaczonego #a4c639miejsca!" , 255 , 255 , 255 , true )
skrzyneczka = createObject ( 2912 , 0 , 0 , 0 , 0 , 0 , 0 , true )
attachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
setPedAnimation ( localPlayer , "CARRY" , "crry_prtial" , 1 , true )
toggleControl ( "sprint" , false , localPlayer )
toggleControl ( "jump" , false , localPlayer )
toggleControl ( "fire" , false )
setElementData ( localPlayer , "skrzynkaposiadana" , true )
local losowanie = math . random ( 2 , #magazynlokacje)
cel = createMarker ( magazynlokacje [ losowanie ][ 1 ], magazynlokacje [ losowanie ][ 2 ], magazynlokacje [ losowanie ][ 3 ]- 1.0 , "cylinder" , 1.0 , 255 , 0 , 0 )
blipcel = createBlipAttachedTo ( cel , 12 )
addEventHandler ( "onClientMarkerHit" , cel , magazynierkoniec )
end
end
function magazynierkoniec ( hitElement , matchingDimension )
if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) then
setElementData ( localPlayer , "skrzynkaposiadana" , false )
outputChatBox ( "#00B7FFOdk?adasz #00B7FFpaczk?, #00B7FFpoczekaj #00B7FFchwil?!" , 255 , 255 , 255 , true )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
toggleControl ( "fire" , true )
detachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
destroyElement ( skrzyneczka )
destroyElement ( cel )
destroyElement ( blipcel )
setPedAnimation ( localPlayer )
Wysłany: 2021-05-05, 18:26
0nly6
Support-Team
Wiek: 23 Na forum: 2437 dni Posty: 54
Nick w MP: duhack
Piwa : 1040
"Szyszka947" napisał/a :Nie wiem jak to jest w lua, ale zazwyczaj zmienna w funkcji nie wychodzi poza funkcj?. Spr?buj:
skrzyneczka = nil
cel = nil
blipcel = nil
function magazynierpraca ( button )
if button == "left" then
guiSetVisible ( guimagazynier , false )
guiSetVisible ( guilabel , false )
showCursor ( false )
outputChatBox ( "#a4c639Zanie? #a4c639paczk? #a4c639do #a4c639wyznaczonego #a4c639miejsca!" , 255 , 255 , 255 , true )
skrzyneczka = createObject ( 2912 , 0 , 0 , 0 , 0 , 0 , 0 , true )
attachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
setPedAnimation ( localPlayer , "CARRY" , "crry_prtial" , 1 , true )
toggleControl ( "sprint" , false , localPlayer )
toggleControl ( "jump" , false , localPlayer )
toggleControl ( "fire" , false )
setElementData ( localPlayer , "skrzynkaposiadana" , true )
local losowanie = math . random ( 2 , #magazynlokacje)
cel = createMarker ( magazynlokacje [ losowanie ][ 1 ], magazynlokacje [ losowanie ][ 2 ], magazynlokacje [ losowanie ][ 3 ]- 1.0 , "cylinder" , 1.0 , 255 , 0 , 0 )
blipcel = createBlipAttachedTo ( cel , 12 )
addEventHandler ( "onClientMarkerHit" , cel , magazynierkoniec )
end
end
function magazynierkoniec ( hitElement , matchingDimension )
if getElementType ( hitElement ) == "player" and not isPedInVehicle ( hitElement ) then
setElementData ( localPlayer , "skrzynkaposiadana" , false )
outputChatBox ( "#00B7FFOdk?adasz #00B7FFpaczk?, #00B7FFpoczekaj #00B7FFchwil?!" , 255 , 255 , 255 , true )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
toggleControl ( "fire" , true )
detachElements ( skrzyneczka , localPlayer , 0 , 0.75 , 0 , 0 , 0 , 0 )
destroyElement ( skrzyneczka )
destroyElement ( cel )
destroyElement ( blipcel )
setPedAnimation ( localPlayer )
Akurat w Lua zmienne wychodz? poza funkcje.
Chyba, ?e przed zmienn? dodamy local - wtedy nie jest to zmienna globalna, a lokalna i jest dost?pna jedynie w w jej funkcji.
Tutaj wi?cej o tym: https://www.lua.org/pil/4.2.html
Podpis
SUPPORT TEAM - 03.05.2021 - teraz
Tagi: destroy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: