Basil.
Wiek: 24 Na forum: 3723 dni Posty: 80
Nick w MP: njefjem
Mia?em skrypt na suszark?, z tym ?e jedna czynno?? w niej by?a wolna, wi?c postanowi?em ?e zrobi? w niej tam zniszczenie pojazdu. Problem w tym ?e wybieram to na suszarce, klikam i wy?wietla si? tylko info na chacie, co robi? ?le?
Kod: isBike = {[509]=true, [481]=true, [510]=true} -- rowery
function oddajPojazdDoPrzechowywalni(veh, player, id, bool)
if isElement(veh) then
local acc = getPlayerAccount(player)
if acc then
local wlasciciel = getElementData(veh, "car_owner")
local model = getElementModel(veh)
dbExec(handler, "INSERT INTO przechowywalnia VALUES('"..id.."', '"..model.."', '"..wlasciciel.."')")
if isElement(player) then
if bool then
outputChatBox("Tw?j pojazd "..getVehicleName(veh).." zosta? umieszczony w przechowywalni.", player, 255, 255, 255, true)
else
outputChatBox("Odda?e? pojazd "..getVehicleName(veh).." do przechowywalni.", player, 255, 255, 255, true)
end
end
destroyElement(veh)
end
end
end
addEvent("onDryerAction", true)
addEventHandler("onDryerAction", root,
function(typ,selected,el)
if not el or not selected then return end
if typ == "player" then
if selected == 1 then
local x,y,z=getElementPosition(source)
setElementPosition(el,x,y,z+2)
outputChatBox("Przenios?e? gracza do siebie.", source)
end
if selected == 2 then
outputChatBox("Wykopa?e? tego gracza z powodem: Polacz sie ponownie", source)
end
if selected == 3 then
local x,y,z=getElementPosition(el)
setElementPosition(source,x,y,z+2)
outputChatBox("Przenios?e? si? do gracza.", source)
end
end
if typ == "vehicle" then
if selected == 1 then
_,_,rz=getElementRotation(el)
fixVehicle(el)
setElementHealth(el,1000)
setElementRotation(el,0,0,rz)
setElementFrozen(el,false)
outputChatBox("Naprawi?e?/a? pojazd.", source)
end
if selected == 2 then
local x,y,z = getElementPosition(source)
setElementPosition(el,x+2,y,z)
setElementFrozen(el,false)
outputChatBox("Pomy?lnie przeniesiono pojazd.", source)
end
if selected == 3 then
local id = getElementData(el, "car_id")
oddajPojazdDoPrzechowywalni(el, source, id)
end
if selected == 4 then
if isBike[getElementModel(el)] then return end
if isElementFrozen(el) then
setElementFrozen(el, false)
outputChatBox("Spu?ci?e? r?czny w zaznaczonym pojezdzie.", source)
else
setElementFrozen(el, true)
outputChatBox("Zaci?gn??e? r?czny w zaznaczonym pojezdzie.", source)
end
end
if selected == 5 then
destroyElement()
outputChatBox("Pomy?lnie zniszczy?e? pojazd.", source)
end
end
end)