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
Witam mam problem z usuwaniem pojazdu poniewasz usuwa pojazd ale jak ktos w nim jest i wyjdzie z gry to ju? nie usuwa mo?e kto? mi pomoc troch? poprawi? skrypt ?
Za pomoc
kod
[code]
function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end
addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "zrespilGracz") then
outputChatBox("praca w trakcie poprawek", el)
return
end
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
local x,y,z = getElementPosition(el)
local bus = createVehicle(437, x,y,z,0.0, 0, 180)
addEvent("STOPJobBus", true)
addEventHandler("STOPJobBus", resourceRoot, function()
local pojazd = getPedOccupiedVehicle(localPlayer)
if pojazd then
destroyElement(po...
Pr?bowa?em dzisiaj doda? do komendy funkcje detroy ?eby usuwa?o pojazd gdy gracz wpisze znowu komende lecz niestety nie u da?o mi si? tego zrobi? i zwracam si? do was o pomoc:
WITAM potrzebuje pomocy, a mianowicie chodzi o to ?e jak si? wychodzi z pojazdu to go usuwa ale tylko pojazd z ID 532 - czyli kombaj. zrobi?em takie co?
function destroyVehicle(vehicle)
local check=false
for i,player in ipairs(getElementsByType("player")) do
if getPlayerOccupiedVehicle(player)==vehicle then
check=true
end
end
if check==false then
destroyElement(vehicle)
end
end
function exitVehicle(vehicle)
setTimer(destroyVehicle,300,1,vehicle)
end
addEventHandler("onPlayerVehicleExit",getRootElement(),exitVehicle)
Jak zrobi? aby usuwa?o TYLKO ID 532 bo na razie usuwa wszystko. Prosz? o szybk? pomoc to dla mnie wa?ne
Witajcie , ot?? w moim panelu logowania doda?em i? przy wej?ciu na serwer gra muzyka , w planie jest zrobione i? po zalogowaniu w??cza sie "?ywsza cze??" muzyki , jednak pr?bowa?em u?yc funkcji DestroyElement jednak na nic , po zalogowaniu graj? oby dwie muzyki , kod w kt?y m"w?acza sie" ta druga muzyka jest taki :
addEventHandler("accounts:login:attempt", getRootElement(),
function (statusCode, additionalData)
if (statusCode == 0) then
LoginScreen_closeLoginScreen()
local sound = playSound("2.mp3")
if (isElement(warningBox)) then
destroyElement(warningBox)
destroyElement(playSound("1.mp3"))
end
Prosi?bym o pomoc , tam na dole u?y?em funkcji DestroyElement jednak niestety nic to nie da?o.