Witam, jak naprawi? taki b??d? Totalnie nie mam pomys?u
b??dy
[lua]
278: Bad argument @ 'destroyElement' [Expected element at argument 1]
279: Bad argument @ 'destroyElement' [Expected element at argument 1]
[/lua]
c_side
[lua]
--[[
@
@
@
@
@
@
@
@
--]]
local startPracyMagazyn = createMarker(-1549.52,1165.43,7.19-0.9, "cylinder", 1.2, 255, 170, 0, 60)
setElementData(startPracyMagazyn, "marker:icon", "praca")
--local oznaczeniePracy = createBlip(-2109.26,-2.57,35.32, 46,2, 255, 0, 0,255,0,500)
local screenW, screenH = guiGetScreenSize()
local dxfont0_normal = dxCreateFont(":buttony-MoveRPG/normal.ttf", 17)
local dxfont1_normal = dxCreateFont(":buttony-MoveRPG/normal.ttf", 10)
local dxfont3_normal = dxCreateFont(":buttony-MoveRPG/normal.ttf", 17)
local dxfont4_normal = dxCreateFont(":buttony-MoveRPG/normal.ttf", 10)
local dxfont5_normal = dxCreateFont(":buttony-MoveRPG/normal.ttf", 12)
px, py = (screenW/1024), (screenH/768)
addEventHandler("onClientMarkerHit", startPracyMagazyn, function(h)
if h ~= localPlayer then return end
if isPedInVehicle(localPlayer) then return end
setElementData(localPlayer, "praca:magazyn:gui", true)
showCursor(true)
end)
function isMouseIn ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
...
Witam napodka?em kolejny problem nie mog? usun?? pojazdu z lawety podaje kod
local laweta = createVehicle(578,2603.83789, -2345.23291, 14.29792,0,0,180)
function zaladunek (thePlayer)
if not isElementWithinMarker( thePlayer, zmarker ) then return end
local theVehicle = getPedOccupiedVehicle ( thePlayer ) local v = createVehicle ( 415, 0, 0, 0) attachElements(v, theVehicle, 0.2, -2, 0.4 ) destroyElement(zmarker) rmarker = createMarker(2686.32129, -2408.83032, 13.48673, "cylinder", 4,123,231,234) end
addCommandHandler("zaladuj",zaladunek)
function rozladunek (plr)
if not isElementWithinMarker (plr, rmarker) then return end
destroyElement(laweta) end
addCommandHandler("rozladuj",rozladunek)
mam taki problem z destroyElement, ?e jak wychodz? z auta to nie usuwa marekara i blipa.
tutaj kod
[code]function RozpocznijPrace(button, state)
if panelpraca and button == "left" and state == "down" then
if cursorPosition(screenW * 0.5578, screenH * 0.4740, screenW * 0.1025, screenH * 0.0443) then
if not isElementWithinMarker(localPlayer, praca) then return end
if not getElementData(localPlayer, "player:job") then
removeEventHandler ("onClientRender", root, GuiPracka)
panelpraca = false
showCursor(false)
local losuj = math.random(2, #miejscaelektryk)
setElementData(localPlayer, "player:job", true)
triggerServerEvent ("DajAutko", localPlayer)
local punkt = createMarker(miejscaelektryk[losuj][1], miejscaelektryk[losuj][2], miejscaelektryk[losuj][3]-1.0, "cylinder", 3.0, 255, 0, 0)
local blip = createBlipAttachedTo(punkt, 41)
addEventHandler("onClientMarkerHit", punkt, function(el, md)
if not md or el~=localPlayer then return end
local veh=getPedOccupiedVehicle(el)
if not veh then return end
if getVehicleController(veh) ~= localPlayer then return end
setElementFrozen(veh,true)
setElementFrozen(el, true)
setTimer(function()
setElementFrozen(veh,false)
setElementFrozen(el, false)
...
Posiadam kodzik:
[lua]function weztorba(plr)
local login = getAccountName(getPlayerAccount(plr))
if sprawdzStrazaka(login) then
local auto = getPedOccupiedVehicle(plr)
if isPedInVehicle(plr) then
if (getElementModel(auto) == 489) or (getElementModel(auto) == 407) or (getElementModel(auto) == 416) then
local torba = createObject(1210, 0, 0, 0, 0, 0, 0)
exports.bone_attach:attachElementToBone(torba,plr,12,0,0.1,0.3,0,180,0)
outputChatBox("** Bierzesz torb? medyczn?", plr)
outputChatBox("** "..login.." wyci?ga torb? medyczn? z pojazdu", root)
zapiszlog(login.." wyci?ga torb? medyczn? z wozu")
end
end
end
end
addCommandHandler("torba", weztorba)
-------------------------------------------------
function odloztorbe(plr)
local login = getAccountName(getPlayerAccount(plr))
if sprawdzStrazaka(login) then
local auto = getPedOccupiedVehicle(plr)
if isPedInVehicle(plr) then
if (getElementModel(auto) == 407) or (getElementModel(auto) == 489) or (getElementModel(auto) == 416) then
destroyElement(torba)
outputChatBox("** Chowasz torb? medyczn?", plr)
outputChatBox("** "..login.." chowa torb? medyczn? do pojazdu", root)
zapiszlog(login.." chowa torb? medyczn? do wozu")
end
end
end
end
addCommandHandler("odloztorbe", odloztorbe)[/lua]
Lecz nie usuwa mi torby Pr?bowa?em na setki sposob?w, ale dalej nic ;/
Postanowi?em napisa? tutaj, aby?cie podsun?li mi p...
Witam mam taki problem jak wjad? w marker5 to nie znika mi poci?g ale robi si? dalsza cz??? skryptu, lecz mojemu koledze i innym kt?rzy pracuj? i jad? za mn? auto znika (Lecz oni nie wje?d?aj? jeszcze w marker). Tak samo jest w przypadku marker6.
Oto Kod:
Client:
[lua]function przeladuj2(hitElement)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if auto then
destroyElement(marker5)
destroyElement(blip3)
triggerServerEvent("zaladunekPaliwa", localPlayer, localPlayer)
outputChatBox("Jed? na stacj? paliw, aby dostarczy? paliwo do dystrybutora.", 255, 255, 255)
marker6 = createMarker(23.25203, 1175.06689, 18.40798, "cylinder", 3, 0 ,255, 0, 200)
addEventHandler("onClientMarkerHit", marker6, addFuel)
blip4 = createBlip(23.25203, 1175.06689, 19.40798, 41)
end
end
end
function addFuel(hitElement)
auto = getPedOccupiedVehicle(localPlayer)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
if auto then
tekst3 = guiCreateLabel(905, 580, 340, 138, "Roz?adowywanie Paliwa na stacj?. Prosz? czeka? 15 sekund.", false)
guiSetFont(tekst3, "default-bold-small")
guiLabelSetColor(tekst3, 0, 255, 0)
setElementFrozen(auto, true)
setTimer(function()
rnd = math.random(45, 65)
setElementFrozen(auto, false)
givePlayerMoney(rnd)
destroyElement(marker6)
destroyElement(blip4)
destroyElement(tekst3)
outputChatBox("Po zako?cz...
function destroyVehicle(thePlayer, seat, jacked) auto1 = getPedOccupiedVehicle(thePlayer) id = getElementModel(auto1)
if id == 573 then
destroyElement(auto1) end
end
addEventHandler("onPlayerVehicleExit", getRootElement(), destroyElement)
Czemu jak wyjd? z pojazdu kt?ry nie ma id 573 to si? uswa ?
Witam mam problem z kodem na prace. Chodzi mi o to ?e gdy wchodze w marker to ten wy?wietla mi podw?jn? wiadomo?? ( przy starcie skryptu wiadomo?? te? si? wy?wietla a nie mam tego tak ustawione) oraz nie niszczy si? tylko wy?wietla b??d.
function ladowanie (Player)
outputChatBox ( "#FF0000Rozpocze?e? prace rowo?enia burger?w. Twoim celem jest dostarczy? burgery do miejsca oznaczonego blipem na mapie", getRootElement(), 255, 255, 255, true)
destoryElement (ladowanie)
end
addEventHandler("onMarkerHit", getRootElement(), ladowanie)
Zapomnia?em doda? ?e gdy wjade w teren gdzie stoi marker robi si? niebieskie niebo