Dopiero zaczynam zabaw? z mapedytorem mta i pojawia si? tu pytanie odno?nie usuwania obiekt?w. Mam na my?li usuwanie dok?adnie jaki? znak?w lini energetycznych. Pozosta?o?ci po skasowaniu niekt?rych budynk?w.
Niekt?rych budynk?w z mo?liwo?ci? skasowania lecz ustawienia pod?ogi.
Prosi? bym o jak najdok?adniejszy opis lub poradnik.
Cze??. Nie dzia?a mi funkcja na usuwanie pojazdu gdy wje?dzam w marker.
Marker si? tworzy, lecz po wjechaniu nic si? nie dzieje. B??d?w w DB3 nie ma.
Kod Client-Side:
[lua]
function kurier()
if pracakurier == true then
local zakonczkurier = createMarker(2190.05, -2252.70, 13.49-1, "cylinder", 2.0, 255, 0, 0, 80)
local t=createElement('text')
setElementData(t,'name','Aby zako?czy? prac? kuriera.n wjed? tu.')
setElementPosition(t,2190.05, -2252.70, 13.49+1)
addEventHandler("onClientMarkerHit", zakonczkurier, function (he)
if getElementType(he) == "vehicle" then
gracz = getVehicleController(he)
elseif getElementType(he) == "player" then
gracz = he
end
if getElementData(he, "pojazd_kurierdhl") then
destroyElement(he or getPedOccupiedVehicle(he))
triggerServerEvent("przywrocs", localPlayer)
exports["noti"]:noti("Ko?czysz prac? kuriera!", localPlayer)
destroyElement(zakonczkurier)
destroyElement(t)
setElementData(localPlayer, "player:job", false)
pracakurier = false
trzymasz = false
paczka = 0
del()
ulatw()
removeEventHandler("onClientRender", root, wyswietlanie)
usunk1()
usun23()
usun13()
usun12()
end
end)
end
end
[/lua]
Siema!
Zrobi?em taki skrypt, aby usuwa?o samoch?d po wyj?ciu z serwera.
Lecz gdy dzi? to przetestowa?em, to nie wa?ne kto wyjdzie z serwera, to i tak usunie ten pojazd, a chcia?bym ?eby usuwa?o, tylko wtedy gdy wyjdzie osoba, kt?ra w nim siedzia?a.
Witam! Mam problem, poniewa? chcia?bym zrobi? gdy wejdziemy w marker (kt?ry znajdujie si? po Client-Side) usuwa?o pojazd, kt?ry zrespi?em po Server Side:
Kod do Server: https://pastebin.com/ZxVWVHGb
Kod do Client: https://pastebin.com/JXTQ6nRS
Cze??, mam taki kod ( ni?ej ) i jak podmi?? wylosowane markery pod funkcje usuwania ich?
[lua]mrozpo = createMarker(2744.3510742188,-2453.7,12.86225605011,"cylinder",1.1,255,255,255,100)
local mmiejsca = {
{2781.9846191406,-2450.6713867188,13.635081291199},
{2782.0900878906,-2448.1870117188,13.635055541992},
{2782.0646972656,-2446.4736328125,13.635061264038},
{2781.9970703125,-2461.3837890625,13.635078430176},
{2782.0153808594,-2463.3923339844,13.635073661804},
{2782.0344238281,-2465.6652832031,13.635068893433},
{2785.318359375,-2450.6000976563,13.634265899658},
{2785.3686523438,-2448.8005371094,13.634254455566},
{2785.3825683594,-2446.7805175781,13.634250640869},
{2785.2280273438,-2461.4089355469,13.634288787842},
{2785.2360839844,-2463.6157226563,13.634286880493},
{2785.1474609375,-2465.6157226563,13.634307861328},
{2790.1884765625,-2461.6752929688,13.63307762146},
{2790.4169921875,-2463.6364746094,13.633021354675},
{2790.4440917969,-2465.9130859375,13.633014678955}
}
addEventHandler("onMarkerHit",mrozpo,function(plr)
outputChatBox("Rozpocznij prac?: true.",plr)
local los=math.random(2,#mmiejsca)
local punkt=createMarker(mmiejsca[los][1],mmiejsca[los][2],mmiejsca[los][3]-1,"cylinder",1.1,255,255,255,50)
local blip = createBlip( mmiejsca[los][1], mmiejsca[los][2], 58, 0, 0, 0, 255 )
end)
addEventHandler("onMarkerHit",function()
outputChatBox("Dostarcz i usu?: true.",plr)
destroyElemen...
Witam, mam skrypt na prace.. Jest to praca Nurka.. Ale niestety nie potrafie zrobic usuniecia pojazdu po 60 sekundach. Tzn. pojazd usuwa mi od razu po wyjsciu, a ja chce aby usuwalo go po 60 sekunach A oto kody:
client:
[code]--[[
Praca StreetView
Skrypt wykonal: Nikodem S. (NoKill)
]]--
local text=createElement("text")
local districtsBus = {
{-2184.58,-2356.55,30.47},
{-2169.67,-2340.81,30.47},
{-2158.11,-2325.75,30.47},
{-2160.49,-2306.73,30.47},
{-2192.00,-2281.82,30.47},
{-2265.60,-2220.81,30.32},
{-2165.55,-2150.53,50.96},
{-2082.33,-2017.06,61.91},
{-1991.33,-1864.71,41.40},
{-1831.20,-1733.15,29.12},
{-1663.72,-1639.33,36.26},
{-1541.88,-1588.72,37.73},
{-1718.37,-1481.05,34.49},
{-1903.30,-1375.03,40.13},
{-1901.91,-1339.67,40.34},
{-1897.04,-1262.76,39.48},
{-1821.43,-1212.52,38.46},
{-1872.41,-1154.33,29.95},
{-1968.87,-1140.94,29.85},
{-1986.16,-1026.65,32.02},
{-1971.44,-1006.86,32.02},
{-1948.94,-1008.65,32.02},
{-1949.56,-1064.47,31.64},
{ -1949.97,-1084.40,30.77},
Witam chc? usun?? element po wyj?ciu z pojazdu, lecz nic si? nie dzieje i ?eby znika?a element data "pbetoniara:zatrudniony" - to mog? sobie samemu dorobi?, tylko chcia?bym aby po wyj?ciu z pojazdu usune?a si? betoniara jednemu graczowi (temu co pracowa?)
local table = {
{"Test1"},
{"Test2"},
}
function removePlayerFromTable(player, table) local oldTable = table
local newTable = nil for i, plr in pairs(oldTable) do outputChatBox( plr[1] )
if plr[1] == player then
table.remove(oldTable, i) end
end
newTable = oldTable
end
removePlayerFromTable("Test1", table)
B??d: attempt to call field 'remove' (a nil value)
Nie ogarniam co robie zle
mam problem bo usuwa gracza z pracy ale nie zmienia liczby wolnych miejsc.
che aby codziennie o 20:00 zwalnia?o wrzystkich i robi?o 0 miejsc.
setTimer(function() local result = exports['ogrpg-db']:dbGet("SELECT * from ogrpg_jobs WHERE actived<NOW() - INTERVAL 1 DAY;")
if result and #result > 0 then for i,v in pairs(result) do exports['ogrpg-db']:dbSet("DELETE FROM ogrpg_jobs WHERE code=? and uid=?? and actived=?",v.code,v.uid,v.actived) exports['ogrpg-db']:dbSet("UPDATE ogrpg_office set spaces=0 where code=?",v.code) outputDebugString("Wyczyszczono prace z nieaktywnych os?b!") end
end
end, 86400000, 0)
mam taki problem z prac? gdy gracz oddaje obiekt i gdy 2 gracze te? ma obiekt to gdy ten 1 odda obiekt usuwa 1 i 2
tutaj kod
function UsunGazObiekt(plr)
for i,v in ipairs(getElementsByType("object", resourceRoot)) do
if getElementData(v, "job:gaz") ~= getPlayerName(plr) then
destroyElement(v) end
end
end
chia?bym zrobi? co? takiego gdy wchodzi gracz do marker to usuwa si? obiekt 1 a gdy wejdzisz 2 raz do markera to usuwa si? obiekt 2 czy da?o by si? zrobi??
Napisa?em sobie prost? komende kt?ra usuwa wszystkie nie uzywane pojazdy w dim 1.. nie ma b??d?w lecz gdy wpisze /usun nic si? nie dzieje tylko wy?wietla mi tekst ">> Uwaga.."
Mimo wszystko, nie usuwa mi pojazd?w.
addCommandHandler("usun", function(plr,vehicle) local accName = getAccountName ( getPlayerAccount ( plr ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "event" ) ) then
outputChatBox(">> Uwaga..",root,255,0,0,true)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
if ( getElementDimension ( v ) == 1 ) then if not getPlayerOccupiedVehicle(plr)==v then
destroyElement(vehicle[v]) end
end
end
end
end)
Witam,
zrobi?em za pomoc? tabeli tworzenie smieci tworzy ich 20 i do kazdego przypisany jest marker i blip. M?j problem jest taki ?e chce w pewnym momencie usun?? konkretny smie? a z nim przypisany mu blip i marker. Ale kiedy dam destroyElement, usuwa wszystkie markery,blipy,smieci. Kto? ma pomys? jak rozwi?za? ten problem?
function StworzSmieci ()
for i = 1,20 do local losujs = math.random ( 1, #Pozycja_Smieci ) local xs,ys,zs = Pozycja_Smieci[losujs][1], Pozycja_Smieci[losujs][2], Pozycja_Smieci[losujs][3] smiec = createObject(1265, xs, ys, zs - 0.5) markerk_smiec = createMarker ( 0, 0, 0, "cylinder", 1, 255, 0, 0, 255 ) smiec_blip = createBlipAttachedTo(markerk_smiec, 0,1,255,0,0,0) attachElements ( markerk_smiec, smiec, 0, 0, 0) end
end
witam od jakiego? czasu my?l? jak usun?? plik ze strony "client.lua" , chodzi mi to je?li mam serwer i nowy gracz pobiera zas?b to z?by strona "client" usuwa?a si? nie by?a widoczna w folderze mods/deathmatch/resources/jaki? folder z servera z plikiem lua
jak to zrobic ? za pomoc stawiam
Zabra?em si? znowu za pisanie skryp?w. Ale przez ostatni czas siedzia?em raczej w Javie, HTMLu i PHP. Nie mog? si? wczu?, a chcia?em zrobi? tylko jedn? ma?? rzecz.
Potrzebuj? skryptu, kt?ry pod wp?ywem komendy usuwa?by mi mask? z pojazdu.
Da rad?? Wiem ?e da, tylko nie moge do tego doj??.
Rzuc? piwkiem dla pierwszej osoby, kt?ra mi powie jak to ma wygl?da?.
Lepiej po stronie serwera czy klienta?
mi?oby by?o dosta? w miar? szybk? odpowied?
function maska (thePlayer,command) local vehicle = getPedOccupiedVehicle(thePlayer) setVehicleDoorState (vehicle 0, 0) end
addCommandHandler ("maska", maska)
Witam. Mam ten kod i chcia?bym aby by? on pod komend? lecz moje pr?by nie udawa?y si?. Wi?c prosz? pom??cie.
if itemName == "removetire" then
local col = getElementData(getLocalPlayer(),"currentCol")
if getElementData(col,"tire_inVehicle") >= 1 and getElementData(getLocalPlayer(),"Toolbox") >= 1 then
local col = getElementData(getPlayer(),"currentCol") setElementData(getLocalPlayer(),"Tire",(getElementData(getLocalPlayer(),"Tire") or 0)+1) setElementData(col,"Tire_invEhicle",getElementData(col,"Tire_inVehicle")-1) setPedAnimation(getLocalPlayer(),"BOMBER","BOM_Plant",nil,false,false,nil,false) triggerEvent("displayClientInfo",getLocalPlayer(),"Vehicle","You removed 1 Tire from vehicle",255,255,255) disableMenu()
return end
end
Witam mam problem z usuwaniem opisu pojazdu jak si? wypchnie auta puste to nie znika opis a jak wyjad? pojazdem to znika
za pomoc stawiam
local strefa = createColCuboid(-1991.49, 419.51, 35.17-1, 30, 36.2, 6)
addEventHandler("onClientColShapeHit", strefa, function(el, md)
if not md or el ~= localPlayer then return end if wjazd then return end
wjazd = true
end)
addEventHandler("onClientColShapeLeave", strefa, function(el, md)
if not md or el ~= localPlayer then return end if not wjazd then return end
local veh = getPedOccupiedVehicle(el)
if not veh then return end
setElementData(veh,"pojazd_opis",false) end)
witam mam taki o to problem bo chce zrobi? usuwanie pojazdu ale tak ze je?li peda (gracza) nie ma w aucie to gdy damy auto w marker (np: pchaj?c go) to usuwa ten pojazd
Za pomoc stawiam
local test = createMarker(-1969.4, 480.79999, 35.17-1, "cylinder", 3, 255, 0, 0, 100)
addEventHandler("onMarkerHit", test, function(el,md)
if getElementType(el) == "player" then
local auto = getPedOccupiedVehicle(el)
if not auto then return end if getVehicleController(auto) ~= el then return end if isTimer(czas) then return end
czas = setTimer(function() destroyElement(auto) end, 3000, 1) end
end)
Siema. Mam problem z usuwaniem autobusu, poniewa? jak kto? z niego wyjdzie (i chyba jak uko?czy prac?), to pojazd si? nie usuwa i taki ?mietnik si? robi. B??d w db3 jest taki, i? nie mo?e znale?? eventu "destroyVeh" po stronie serwera . Jak przecie? jesy dodany.. Wie kto? o co chodzi? Stawiam
Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie by? mo?e si? zgodz? na u?ycie kodu.
]]--
createBlip(-1755.05, 951.73, 23.74,52, 2, 255,0,0,255,0,400)
local m1 = createMarker(-1755.05, 951.73, 23.74, "cylinder", 4.0, 255, 0, 0)
vehs = {}
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, 360.0, 269.9)