function cv(plr, cmd, ...)
if getElementData(plr,"player:admin") ~= true then return end
if getElementData(plr, "player:level") == 4 or 3 then
if (not ...) then
outputChatBox("#FF0000* #FFFFFFPoprawne u?ycie: /cv <model>", plr,0,0,0,true)
return
end
local model = table.concat ( { ... }, " " )
if tonumber(model) ~= nil then
outputChatBox("#FF0000* #FFFFFFWpisz model a nie ID!", plr,0,0,0,true)
return end
local model = model:lower()
if zablokowane[model] then
outputChatBox("#FF0000* #FFFFFFTen pojazd jest zablokowany!", plr,0,0,0,true)
return end
local dim = getElementDimension(plr)
local int = getElementInterior(plr)
local x,y,z = getElementPosition(plr)
local r1,r2,r3 = getElementRotation(plr)
local model = getVehicleModelFromName(model)
if not model then outputChatBox("#FF0000* #FFFFFFNie ma takiego pojazdu!", plr,0,0,0,true) return end
local vehicle = getPedOccupiedVehicle(plr)
if getPedOccupiedVehicle(plr) then
outputChatBox("#FF0000* #FFFFFFNajpierw wysi?d? z pojazdu!", plr,0,0,0,true)
else
pojazd = ...
Witam, na paczce PYS 3.0 nie zapisuj? si? statystyki gdy wyjdziemy z serwera podczas wybierania miejsca spawnu (ale w innych przypadkach si? zapisuj?). A wi?c przychodz? z zapytaniem co nale?y zrobi?, aby te statystyki zapisywa?y si? zawsze.
Chce usun?c WSZYSTKIE obiekty na raz z iv inpairsa ale nie umiem
local obj function niedzialami()
if obj and isElement(obj) then
destroyElement(obj) obj = nil
end
end
for i,v in pairs(cialo2) do markery=createMarker(v[1],v[2],v[3]-1,"cylinder",1,255,255,255,255,el) local losuj = math.random(1,#objekty) blipchuj=createBlip(-1900.24,860.99,35.02,12) obj=createObject(objekty[losuj][1],v[1],v[2],v[3],360,360,0) addEventHandler("onClientMarkerHit",markery,wlazwmarker) end
UZYTE W FUNKCJI LINIJKE POD STWORZENIEM LODZI ! triggerServerEvent("lodka",resourceRoot)
addEventHandler("onClientResourceStop", resourceRoot, function()
if jobVehicle and getElementData(localPlayer, "player:job") then
setElementData(localPlayer, "player:job", false) triggerServerEvent("rozwal",root,jobVehicle) end
end)
SSIDE
local lodz
addEvent("lodka",true) addEventHandler("lodka",resourceRoot,function() triggerClientEvent(client,"wudka",resourceRoot,lodz) end)
addEvent("warplodz",true) addEventHandler("warplodz",resourceRoot,function(el)
if not el then return end
lodz = createVehicle(595, -1900.60, 1403.90, 0.00, 3.1, 358.7, 349.6) end)
addEventHandler("onClientVehicleExit", resourceRoot, function(plr, seat)
if seat == 0 then if plr == localPlayer then
triggerEvent('onClientAddNotification', localPlayer, 'Pomy?lnie zako?czono prac?:#00c005nKierowca pojazdu Street View', 'success') destroyElement(source) zakonczprace() end
end
end)
elementem source jest lodz po wyjsciu z niej lodz sie nie usuwa i nie zakancza sie praca (NA AUTA NORMALNIE DZIALA)
Tak jak w temacie jak mog? to przerobi? (obecnie jest to przy wczytaniu konta) by kara usun??a si? bez konieczno?? wyj?cia z serwera
local mute = exports['pystories-db']:dbGet('select * from ec_kary where serial=? AND date>now()',getPlayerSerial(plr))
if #mute > 0 then plr:setData('player:mute',true) outputChatBox('Jeste? wyciszony do: '..mute[1].date,plr)
else exports["pystories-db"]:dbSet("DELETE FROM ec_kary WHERE serial=? AND type=? AND active=1 AND date<NOW()", getPlayerSerial(plr),"mute")
return false
end
for i,pos in ipairs(markers) do markers[i] = createMarker(pos[1], pos[2], pos[3]-1,"cylinder",1.3,255,0,0,255) addEventHandler("onMarkerHit", markers[i], Usuwanko) end
function Usuwanko(player)
if getElementType(player) == "player" then
destroyElement(markers[i]) outputChatBox("marker.",player,255,255,255,true) end
end
no i jak wejd? w kt?ry kolwiek z marker?w aby nie usuwa?y wszystkich tylko ten co gracz do niego wszed?. Musz? rozwi?za? ten problem, je?li ktos wie jak poprawinie u?y? wynagrodz? piwkiem i reputacj?
Witam, mam ot?? taki problem, gdy gracz jest w poje?dzie i wyjdzie z gry. To nie usuwa pojazdu jak to mog? naprawi? ?
b??d w db3
[code]
Bad argument @ 'destroyElement' [Expected argument 1, got nil]
[/code]
B??d jest tutaj
[lua]
destroyElement(pojazd[client])
[/lua]
no witam, tak jak w temacie. Wstawi?em do tabeli np: "myd?o" i teraz chce tylko je usun??. Pr?bowa?em table.removeValue ale co? nie siada. Licz? na pomoc. Z g?ry dzi?ki.
Witam g?owinie chodzi o ''* Nick is now known as Nick''
Pojawia si? zawsze gdy kto? wchodzi na serwer lub wchodzi na duty administracji i frakcji. nie ogarniam za dobrze wiec prosz? dajcie jako? ?atwo opisane
no wszystko dzieje si? fajnie dop?ki ma si? usun?? marker pokazuje si? komunikat po wej?ciu ale marker jak stoi tak stoi
addEventHandler("onVehicleEnter", resourceRoot, function(plr,seat)
if seat ~= 0 then return end
setElementFrozen(source,false) setVehicleDamageProof(source, false) setElementData(plr,"player:job",code) outputChatBox("* Rozpocz??e?(a?) prac?!", plr) outputChatBox("* Dosta?e? zg?oszenie!", plr) triggerClientEvent(plr,'okuczesie',plr) losuj = math.random(1, #miejscaulotk) jobMarker = createMarker(miejscaulotk[losuj][1],miejscaulotk[losuj][2],miejscaulotk[losuj][3]-0.90,"checkpoint",3,0,255,170) blip = createBlipAttachedTo(jobMarker, 21) addEventHandler("onMarkerHit",jobMarker,
function(element,md) local type = getElementType(element)
if type == "player" then
outputChatBox("Odebra?e? klienta zwie? go",element,255,255,255,true) jobMarker = nil -- tu ma si? usun?? marker ale si? tak nie dzieje
end
end) end)
Jak si? uruchamia serwer to wraz z nim uruchamia si? standardowa mapa chyba o nazwie freroman. Wiem ?e chc?c usun?? pojazdy z tej mapy to trzeba edytowa? odpowiedni plik. Czy da si? takie pojazdy usun?? za pomoc? jakie? funkcji czy na to jest tylko taki spos?b jak wspomnia?em wy?ej?
Witam mam pewien problem mianowicie nie usuwa mi gui po wykryciu bana
[lua]
function sprawdzbana()
local result=exports["tiyl-db"]:dbGet('SELECT * FROM tiyl_bany WHERE (serial=? or ip=? or nick=?) and active=1 and type=? and date>now() limit 1', getPlayerSerial(source), getPlayerIP(source), getPlayerName(source), 'ban')
if result and #result > 0 then
triggerClientEvent(source,'wylacz:logowanie',resourceRoot,true)
else
exports["tiyl-db"]:dbSet('UPDATE tiyl_bany SET active=0 WHERE (serial=? or ip=? or nick=?) and type=? limit 1',getPlayerSerial(source), getPlayerIP(source), getPlayerName(source), 'ban')
end
end
addEventHandler('onPlayerConnect',root,sprawdzbana)
[/lua]
[lua]
addEvent("wylacz:logowanie", true)
addEventHandler("wylacz:logowanie", resourceRoot, function(value,info,q)
if not info then return end
if value then
data.showed=false
showZones(data.misc)
removeEventHandler("onClientRender", root,panel_logowania)
exports['editbox']:destroyCustomEditbox('Logowanie-LOGIN')
exports['editbox']:destroyCustomEditbox('Logowanie-HASLO')
exports['editbox']:destroyCustomEditbox('Logowanie-PIN')
exports['editbox']:destroyCustomEditbox('Logowanie-SERIAL')
if sound then
destroyElement(sound)
sound = false
end
Witam, ot?? mam problem, dok?adniej nie wiem jak usun?? pojazd gdy ten wjedzie w marker, pr?bowa?em tak
function ShowMarker(el4) local marker2 = createMarker(-1891.13,1360.56,7.19-1.1,"cylinder", 6, 255, 170, 0,100) destroyElement(veh) end
addEventHandler( "onMarkerHit", marker2, ShowMarker)
kod
local ciezarowka = createMarker(-1976.12,1329.43,7.19-1.1, "cylinder", 2, 255, 170, 0, 100)
function MarkerHit(el2)
if getElementData(el2, "player:ciezarowka", true) then
triggerClientEvent(el2, "onClientAddNotification", el2, "Posiadasz ju? zrespion? ci??ar?wk? !", "info")
return end
local veh = createVehicle(433,-1955.59,1326.85,7.68,0.5,360.0,180.5) warpPedIntoVehicle (el2, veh, 0) setElementData(el2, "player:ciezarowka", true) setElementData(veh, "vehicle:bak", 125) setElementData(veh, "vehicl:fuel", math.random(55,125) ) ShowMarker() end
Witam, jak doda? usuwanie broni z eq jezeli skonczy sie z niej amunicja? Posiadam ekwipunek z newplace. Dodalem bronie do eq i teraz chcialbym zeby po wyjeciu z eq broni i wykorzystaniu calej amunicji usuwalo bron z eq?
Witam ot?? ogarn??em sobie dzi?ki pomocy jednego z u?ytkownik?w tego forum usuwanie report?w z odpowiedziami, mam jeden problem nie mog? dobrze tego podpi?? by usuwa?o report z tabeli.
[lua]
triggerEvent("admin:removeReport", resourceRoot, id)[/lua]
kod
s.lua
[lua]function RGBToHex(red, green, blue, alpha)
if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
return nil
end
if(alpha) then
return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
else
return string.format("#%.2X%.2X%.2X", red,green,blue)
end
end
--admins
function getAdmin(plr,level)
if level then
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?", getPlayerSerial(plr))
if result and #result > 0 then
return true
else
return false
end
end
end
function getLevel(plr)
if plr then
local result=exports["ogrpg-db"]:dbGet("SELECT level from ogrpg_admins WHERE serial=? limit 1", getPlayerSerial(plr))
if result and #result > 0 then
if tonumber(result[1].level) > 0 then
return result[1].level
else
...
Witam ot??, mam pro?b? pom?g? by mi kto? to ogarn?? ze jak wpisujemy /cl id pow?d, to wy?wietla si? to graczowi np /cl 2 ju? IDE. Naprawd? prosi?bym o pomoc
kod
[lua]function RGBToHex(red, green, blue, alpha)
if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then
return nil
end
if(alpha) then
return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha)
else
return string.format("#%.2X%.2X%.2X", red,green,blue)
end
end
--admins
function getAdmin(plr,level)
if level then
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?", getPlayerSerial(plr))
if result and #result > 0 then
return true
else
return false
end
end
end
function getLevel(plr)
if plr then
local result=exports["ogrpg-db"]:dbGet("SELECT level from ogrpg_admins WHERE serial=? limit 1", getPlayerSerial(plr))
if result and #result > 0 then
if tonumber(result[1].level) > 0 then
return result[1].level
else
return false
end
else
return false
end
end
end
Siemanko,mam pytnko.Mo?e kto? zna ID tego obiektu lub ma jakis pomysl jak to wyszuka?.Chce to usunac a gdy usuwam wszystko dooko?a to to co chce usunac zostaje.Wiem jak usunac skryptem lecz nie wiem jakie to ma ID.Przeszukalem wszystkie obiekty w edytorze i nie znalazlem.SS PONI?EJ..za pomoc piwko.dzieki
Witam mam pytanie co zrobi? aby pojazd po zako?czeniu pracy si? usuwa?
oto ostatnia cz??? kodu
[lua]
addEventHandler("onClientMarkerHit", resourceRoot, function(hit)
if hit ~= localPlayer then return end
if source ~= p.marker then
local trawa = getElementData(hit, "trawa")
if trawa > 99 then
("text")
return
end
local traw = math.random(1,4)
setElementData(hit, "trawa", trawa+traw)
if getElementData(hit, "trawa") > 100 then
setElementData(hit, "trawa", 100)
end
destroyElement(getElementData(source, "object"))
destroyElement(source)
end
end)
addEventHandler("onClientMarkerHit", resourceRoot, function(hit)
if hit ~= localPlayer then return end
if source ~= p.marker then return end
local pojazd = getPedOccupiedVehicle(hit)
if not pojazd then return end
local trawa = getElementData(hit, "trawa")
if not trawa then return end
local hajs = getElementData(hit, "pieniadze")
if trawa < 1 then return end
fadeCamera(false)
("") -- notyfikacja
setElementFrozen(pojazd, true)
setTimer(function()
fadeCamera(true)
setElementFrozen(pojazd, false)
local wyplata = 450*trawa/100
wyplata = string.format("%1.2f", wyplata)
setElementData(hit, "pieniadze", hajs+wyplata)
trawa = string.format("%1d", trawa)
noti("") -- to ...
Witam ot?? usuniecie mi linijki kt?re teleportuj? pojazd do przecho po zamontowaniu neon?w?
kod
defs_c.lua
[lua]function isEventHandlerAdded(sEventName, pElementAttachedTo, func)
if type(sEventName) == 'string' and isElement(pElementAttachedTo) and type(func) == 'function' then
local aAttachedFunctions = getEventHandlers(sEventName, pElementAttachedTo)
if type(aAttachedFunctions) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs(aAttachedFunctions) do if v == func then return true end end end
end return false
end
function secondsToClock(seconds)
seconds = seconds or 0
if seconds <= 0 then
return "00:00:00"
else
hours = string.format("%02.f", math.floor(seconds/3600))
mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)))
secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60))
return ""..hours.." godzin "..mins
end
end[/lua]
Witam, ot?? mam taki problem ?e nie wiem jaki kod da? do tego aby usuwa?o oraz zaka?cza?o prace kiedy dostaniemy zakaz prowadzenia A/B/C.
Wiem ?e to jest bardzo banalne ale dzi? co? nie mam do tego g?owy stawiam piwko
addEventHandler("onClientPlayerVehicleExit", getRootElement(),
function (vehicle, seat)
if getElementData(localPlayer, "kurierPraca") == true then
skrzynia[source] = createObject(1271, 0, 0, 0) ---------------- tak to tworze
attachElements ( skrzynia[source], source, 0, 0.5, 0.6) setPedAnimation ( localPlayer, "CARRY", "crry_prtial", 1,true ) setElementCollisionsEnabled(skrzynia[source], false) toggleControl( "jump", false ) toggleControl( "sprint", false ) toggleControl( "crouch", false ) end
end)
To dzia?a ale to:
addEventHandler("onClientVehicleStartEnter", root, function(player,seat,door)
if player == localPlayer then
outputChatBox("test") --------- to dziala
destoyElement(skrzynia[player]) ------------ a tu nie znika skrzynia
end
end)
Witam!
Ot?? mam pewien problem.. gdy usuwam reporta na gracza to powinien mu si? wy?wietli? komunikat: Twoje zg?oszenie przyj??: (PenkY) z odpowiedzi?.. lecz niestety to si? nie dzieje i zamiast jemu wy?wietla si? mi.. M?g?by mi kto? w tym pom?c? ustawi? kod tak aby jemu si? wy?wietla?o? stawiam
[lua]
addCommandHandler("cl", function(plr,cmd,id,...)
if not getAdmin(plr) then
exports["lr_noti"]:addNotification(plr, "* Nie posiadasz uprawnie?.", plr, 255, 0, 0)
return
end
if not id then
exports.lr_noti:addNotification(plr, "Nie wybra?e? ID gracza!", plr)
return
end
local reason=table.concat({...}, " ")
local target=exports["pystories-core"]:findPlayer(plr,id)
opis = "Brak Online"
if target then
id=getElementData(target,"id")
opis=getPlayerName(target)
end
for i,v in ipairs(getElementsByType("player")) do
if getAdmin(v) then
-- if getElementData(v,"player:admin") then
triggerEvent("admin:removeReport", resourceRoot, id)
outputChatBox("#FFFF00CL #FFFFFF> #FF0000"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #919191usun??/??a raport na: #FF0000"..opis:gsub("#%x%x%x%x%x%x","").."#919191/#FF0000"..id.."#919191: #919191"..reason, v, 255, 0, 0, true) -- end
end
end
outputChatBox("* Twoje zg?oszenie przy...