Wysłany: 2019-01-08, 07:25
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Poka? jak Tw?j kod wygl?da teraz.
Wysłany: 2019-01-08, 18:22
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
addEventHandler ( "onPickupHit" , resourceRoot , function( hit )
if getElementType ( hit ) ~= "player" then return end
if isPedInVehicle ( hit ) then return end
if not getElementData ( hit , "user:id" ) then return end
local podkowy = getElementData ( hit , "podkowy" ) or 0
local podkowa = getElementData ( source , "data" )
-- unpack
for k , banan_gracza in ipairs ( podkowy ) do
if banan_gracza == podkowa then
outputChatBox ( "Znaleziona podkowa." , hit )
return
end
end
local a ={}
table . insert ( a , podkowa )
setElementData ( hit , "podkowy" , a )
outputChatBox ( "SPRAWDZ" , hit )
end
)
Wysłany: 2019-01-08, 19:02
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Nie mo?esz tworzy? za ka?dym razem nowej tabeli, wtedy po zebraniu ca?a reszta zebranych podk?w zostanie zresetowana - dzia?asz na pobranej elementDacie, nie tworzysz kolejnych tabel.
Spr?buj tego:
addEventHandler ( "onPickupHit" , resourceRoot , function( hit )
if getElementType ( hit ) ~= "player" then return end
if isPedInVehicle ( hit ) then return end
if not getElementData ( hit , "user:id" ) then return end
local podkowy = getElementData ( hit , "podkowy" ) or {}
local podkowa = getElementData ( source , "data" )
for k , podkowa_gracza in ipairs ( podkowy ) do
if podkowa_gracza == podkowa then
outputChatBox ( "Znaleziona podkowa." , hit )
return
end
end
table . insert ( podkowy , podkowa )
setElementData ( hit , "podkowy" , podkowy )
outputChatBox ( "SPRAWDZ" , hit )
end )
Więcej szczegółów
Wystawiono 1 piw(a):Loop
Wysłany: 2019-01-08, 19:13
Loop
Inspektor
Wiek: 27 Na forum: 4289 dni Posty: 311
Nick w MP: Inspektor
Piwa : 201
Dobra dzia?a, dzieki za pomoc trzymaj i . Do zamkniecia
Tagi: podkowy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: