Witam, mam problem z EZ ( Eazy WorkShop )..
Do rzeczy..
Montuje 4x4, us1, us2, oddaje do przechowalni wchodz? do auta i pisze:
*Pojazd posiada pakiet US1
*Pojazd posiada pakiet US2
*Pojazd posiada Nap?d 4x4
W tym problem ?e nie przy?pieszy?o mi pojazdu. 4x4 dzia?a ale us1, us2 nie
Pomo?e kto? daje zimnego browarka:D
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]
if value then
return value
end
end
return false
end
addEvent("mk2", true)
addEventHandler("mk2", getRootElement(), function()
local hajs = getPlayerMoney(source)
local ccar = getPedOccupiedVehicle(source)
if not ccar then outputChatBox("Musisz by? w poje?dzie", source, 255, 255, 255) return end
if getElementData(source, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", source, 255, 255, 255) return end
if hajs < 480000 then outputChatBox("Nie sta? Ci? na te ulepszenie", source, 255, 255, 255) return end
local id = getElementData(ccar, "vehicle:id")
if not id then return end
local qr = exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND mk2=?",getElementData(ccar, "vehicle:id"), "1")
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255) return end
exports["ogrpg-vehicles"]:onSaveVehicle(ccar)
destroyElement(ccar)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?","MONTAZ US2", id)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?", id)
outputChatBox("Monta? systemu US2 przebieg? pomy?lnie, pojazd zosta? przeniesiony do przechowywalni", source, 255, 255, 255)
takePlayerMoney(source, 480000)
end)
addEvent("mk1", true)
addEventHandler("mk1", getRootElement(), function()
local hajs = getPlayerMoney(source)
local ccar = getPedOccupiedVehicle(source)
if not ccar then outputChatBox("Musisz by? w poje?dzie", source, 255, 255, 255) return end
if getElementData(source, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", source, 255, 255, 255) return end
if hajs < 280000 then outputChatBox("Nie sta? Ci? na te ulepszenie", source, 255, 255, 255) return end
local id = getElementData(ccar, "vehicle:id")
if not id then return end
local qr = exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND mk1=?",getElementData(ccar, "vehicle:id"), "1")
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255) return end
--exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET mk1=1 WHERE ownedPlayer=? AND id=?", getElementData(source, "player:uid"), getElementData(ccar, "vehicle:id"))
exports["ogrpg-vehicles"]:onSaveVehicle(ccar)
destroyElement(ccar)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET mk1=1 WHERE id=?", id)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?","MONTAZ US1", id)
outputChatBox("Monta? systemu US1 przebieg? pomy?lnie, pojazd zosta? przeniesiony do przechowywalni", source, 255, 255, 255)
takePlayerMoney(source, 280000)
end)
addEvent("naped", true)
addEventHandler("naped", getRootElement(), function()
local hajs = getPlayerMoney(source)
local ccar = getPedOccupiedVehicle(source)
if not ccar then outputChatBox("Musisz by? w poje?dzie", source, 255, 255, 255) return end
if getElementData(source, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", source, 255, 255, 255) return end
if hajs < 90000 then outputChatBox("Nie sta? Ci? na te ulepszenie", source, 255, 255, 255) return end
local id = getElementData(ccar, "vehicle:id")
if not id then return end
local qr = exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND naped=?",getElementData(ccar, "vehicle:id"), "1")
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255) return end
--exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET naped=1 WHERE ownedPlayer=? AND id=?", getElementData(source, "player:uid"), getElementData(ccar, "vehicle:id"))
exports["ogrpg-vehicles"]:onSaveVehicle(ccar)
destroyElement(ccar)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?","MONTAZ NAPEDU", id)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET naped=1 WHERE id=?", id)
outputChatBox("Monta? nap?du 4x4 przebieg? pomy?lnie, pojazd zosta? przeniesiony do przechowywalni", source, 255, 255, 255)
takePlayerMoney(source, 90000)
end)
addCommandHandler("*****",function(plr,cmd,tekst)
if getElementData(plr, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", plr, 255, 255, 255) return end
if not tekst then outputChatBox("/"..cmd.."[polowa,caly,usun]",plr) return end
if not maskowanie[tekst] then outputChatBox("/"..cmd.."[polowa,caly,usun]",plr) return end
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("NO ALE k**** PANIE NA DUPE CI TEGO NIE ZAMONTUJE PROSZE WYDUPCZAC STAD NATYCHIAMST",plr) return end
if getPlayerMoney(plr) < maskowanie[tekst][2] then outputChatBox("* Nie masz pienionzkow",plr) return end
takePlayerMoney(plr,maskowanie[tekst][2])
setElementData(veh,"vehicle:masked",false)
setTimer(setElementData,200,1,veh,"vehicle:masked",maskowanie[tekst][1])
outputChatBox(("* ZAMONOTWALES WKYKRUWIONE PANIE JAK TALAL ULBUONE TWOJE MASKOWANIE TO %s"):format(tekst),plr)
end)
addCommandHandler("*****",function(plr,cmd,tekst)
if getElementData(plr, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", plr, 255, 255, 255) return end
if not tekst then outputChatBox("/"..cmd.."[czerwony,niebieski,zielony,zolty,rozowy,bialy,usun]",plr) return end
if not *****[tekst] then outputChatBox("/"..cmd.."[czerwony,niebieski,zielony,zolty,rozowy,bialy,usun]",plr) return end
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("NO ALE k**** PANIE NA DUPE CI TEGO NIE ZAMONTUJE PROSZE WYDUPCZAC STAD NATYCHIAMST",plr) return end
setElementData(veh,"neony",*****[tekst])
outputChatBox(("* ZAMONOTWALES WKYKRUWIONE PANIE JAK TALAL ULBUONE TWOJE PERFEKCYJE DUPERELE KOLORU %s"):format(tekst),plr)
end)
addCommandHandler("k***",function(plr,cmd)
if getElementData(plr, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", plr, 255, 255, 255) return end
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("/k*** w pojezdzie a nie k**** na dupie !",plr) return end
local x= getVehicleUpgradeOnSlot(veh,8)
if x == 1010 then
removeVehicleUpgrade(veh,1010)
else
addVehicleUpgrade(veh,1010)
end
outputChatBox("UZYLES ZAJEBISTEJ KOMENDY ZIEMNIAKU",plr)
end)
addCommandHandler("demontazmaski",function(plr,cmd)
if getElementData(plr, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", plr, 255, 255, 255) return end
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("Nie siedzisz w poje?dzie ",plr,255,0,0) return end
local cena = 8000
local id = getElementData(veh,"vehicle:id")
if not id then return end
local query = exports['ogrpg-db']:dbGet("SELECT removehood from ogrpg_vehicles where id=?",id)
if query and #query > 0 then
local status = tonumber(query[1].removehood)
if status == 0 then
if getPlayerMoney(plr) < cena then outputChatBox("** Nie masz kwoty!",plr,255,0,0) return end
outputChatBox("**Zdemontowa?e? mask? w pojezdzie zabrano "..cena.." PLN",plr,255,0,0)
takePlayerMoney(plr,cena)
setElementData(veh,"vehicle:bonnet",true)
exports['ogrpg-db']:dbSet("UPDATE ogrpg_vehicles set removehood=1 where id=?",id)
elseif status == 1 then
setElementData(veh,"vehicle:bonnet",false)
exports['ogrpg-db']:dbSet("UPDATE ogrpg_vehicles set removehood=0 where id=?",id)
end
end
end)
addCommandHandler("gzcfelu",function(plr,cmd)
if getElementData(plr, "player:organization") ~= "Eazy Workshop" then outputChatBox("Nie nale?ysz do organizacji Eazy Workshop", plr, 255, 255, 255) return end
local veh = getPedOccupiedVehicle(plr)
if not veh then outputChatBox("NIE JESTE? W POJE?DZIE ?YSY CWELU!",plr,255,0,0) return end
local cena = 45000
id = getElementData(veh,"vehicle:id")
if not id then outputChatBox("BAO BAO CI? CWELU",plr,255,0,0) return end
local query = exports['ogrpg-db']:dbGet("SELECT * FROM ogrpg_vehicles WHERE id=? AND rh=?",getElementData(veh, "vehicle:id"), "1")
if query then
if #query == 0 then
if getPlayerMoney(plr) < cena then outputChatBox("NIE MASZ TYLE HAJSU G?UPIA SZMATO! (18500 PLN)",plr,255,0,0) return end
exports['ogrpg-db']:dbSet("UPDATE ogrpg_vehicles set rh=1 where id=?",id)
exports["ogrpg-vehicles"]:onSaveVehicle(veh)
destroyElement(veh)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?","Montaz GZ", id)
outputChatBox("Pojazd zosta? przeniesiony do przechowywalni, GZ ZAMONTOWANE DO ****!",plr,255,0,0)
takePlayerMoney(plr,cena)
elseif #query == 1 then
exports['ogrpg-db']:dbSet("UPDATE ogrpg_vehicles set rh=0 where id=?",id)
exports["ogrpg-vehicles"]:onSaveVehicle(veh)
destroyElement(veh)
exports["ogrpg-db"]:dbSet("UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?","DEMONTAZ GZ", id)
givePlayerMoney(plr,math.floor(cena/2))
outputChatBox("Pojazd zosta? przeniesiony do przechowywalni, GZ ZDEMONTOWANE DO ****! DOSTAJESZ "..math.floor(cena/2).."",plr,255,0,0)
end
end
end)
addCommandHandler("k***?",function(plr,cmd)
if (isGarageOpen(24)) then
-- close the door
setGarageOpen(24, false)
return
end
setGarageOpen(24, true)
end)
addCommandHandler("lickaaa",function(plr,cmd)
if (isGarageOpen(8)) then
-- close the door
setGarageOpen(8, false)
return
end
setGarageOpen(8, true)
end)
To tak:
Podaj Kod zapisu pojazd?w nie Workshop
Aby Handlingi sie nadawa?y z zrespieniem pojazdu:
Dodaj to do zapisu auta
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach