local nlOffsets={
[411]={-1,0,-0.6}, -- infernus
[470]={-1,0,-0.4}, -- patriot
[541]={-0.9,0,-0.4}, -- bulelt
[549]={-0.9,0,-0.4}, -- tampa
[587]={-1,0,-0.5}, -- euros
}
local nlIDX={
3962,2113,1784,2054,2428,2352
}
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
function getAdmin2(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
--///////////////////////////////////// WCZYTYWANIE POJAZD?W /////////////////////...
Gdy go go wrzucam do resources to wpisuje refresh to wszystko jest okej, skrypt si? za?adowa? jest mo?liwy do w??czenia, to /start des-radar w tym przypadku i nadal jest zwyk?y, pomo?ecie?
Cze??! Ot?? mam problem, bo gdy wje?zdam do mechanika. Chc? naprawi? w DebugScriptcie wy?wietla mi si? taki b??d: Error: Client Domskyy triggered Serverside event montazElementu, but event is not added serverside. Jak to naprawi??
Za pomoc daje soczytste
Tak jak w temacie co? nie tak z pr?dko?ci? chcia?em do jednostki po?cigowej w lspd da? moc 320km/h ale gdy doda?em to jest tylko 200 nie wiem dlaczego powie kto? mi dlaczego ?
Witam zmagam si? z problemem przy robieniu pracy Magazyniera ot??, problem polega na tym ?e funkcja podana na dole nie ustawia mi Element daty na false..
Witam robi? prac? czyszczenia ulic i mam problem bo nie dzia?a mi naliczanie KG a ?adne b??dy nie wyskakuj? pomocy
[lua]
local time=getTickCount()
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
local function naliczaj2(veh)
if getTickCount()-time>5000 then
time = getTickCount()
local kg = getElementData(veh,"kilogramy") or 0
local vx,vy,vz = getElementVelocity(veh)
local spd=((vx^2 + vy^2 + vz^2)^(0.5)/2)
if spd>0 then
kg = kg+(spd * 1.25)
setElementData(veh, "kilogramy", kg)
end
end
end
function rendering2()
local pojazd = getPedOccupiedVehicle(localPlayer)
if not pojazd then return end
if getElementData(pojazd,"kilogramy") and getElementData(pojazd,"kilogramy") then
naliczaj2(pojazd)
end
end
addEventHandler("onClientVehicleEnter",root,function(p)
if p ~= localPlayer then return end
if isTimer(timer) then killTimer(timer) end
time=getTickCount()
timer = setTimer(rendering2,5000,0)
end)
addEventHandler("onClientVe...
Bawi?em si? w modowanie GTA IV, lecz co? zepsu?em XD Chcia?em zrobi? reinstall ale wychodzi? b??d - uszkodzony plik data2.cab. By?em zmuszony do pobrania GTA IV, i mam taki problem, GTA si? nie w??cza, a wygl?da to tak:
- W??cza si? logo razora,
- Znika logo razora,
- W??cza si? jaki? "cmd" i nic wiecej
Za pomoc piwko i respekt.. Jak co? pr?bowa?em ju? z r??nym crackami
Gra zpiracona jakby co, wy?ej opisa?em dlaczego zpiraci?em.
kod
[lua]
local zaproszenia = {}
local max_people_in_org = 15 ---- MAKSYMALNA LICZBA LUDZI W ORGANIZACJI!
function findPlayer(plr,cel)
local target=nil
if (tonumber(cel) ~= nil) then
for _,thePlayer in ipairs(getElementsByType("player")) do
if getElementData(thePlayer,"player:uid") == tonumber(cel) then target = thePlayer end
end
else -- podano fragment nicku
for _,thePlayer in ipairs(getElementsByType("player")) do
if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 0, true) then
if (target) then
outputChatBox("Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter.", plr)
return nil
end
target=thePlayer
end
end
end
if target and getElementData(target,"p:inv") then return nil end
return target
end
addEvent("lidero:editUser", true)
addEventHandler("lidero:editUser", resourceRoot, function(text,rank,faction)
local result1=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", text)
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w bazie danych.", client, 255, 0, 0) return end
local result2=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1;", faction, text) -- pobi...
Tak jak w temacie nie dzia?a mi rh1 na pacze Pys 3.0
Kolumna w tabelce jest, w debugu brak b??d?w
Wiem, ?e ten temat by? poruszany na forum wiele razy ale nigdy ?aden nie zosta? rozwi?zany.
gora = guiCreateButton(0.05, 0.46, 0.43, 0.36, "Podwy?sz", true, rh)
dol = guiCreateButton(0.54, 0.46, 0.41, 0.36, "Obni?", true, rh)
guiSetVisible(rh, false)
end
)
addEventHandler("onClientGUIClick", resourceRoot, function(btn)
local veh = getPedOccupiedVehicle(localPlayer)
if source == gora then
triggerServerEvent("rh:p", root, veh)
elseif source == dol then
triggerServerEvent("rh:o", root, veh)
end
end)
function patch()
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then
if rh and ( guiGetVisible ( rh ) == true ) then
guiSetVisible(rh, false)
end
end
end
addEventHandler("onClientRender", root, patch)
function show()
guiSetVisible(rh, true)
end
addEvent( "rhshow", true )
addEventHandler( "rhshow", root, show )
fileDelete("c.lua")[/lua]
Server
[lua]function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and get...
Witam. Mam problem taki jak w tytule czyli gdy chce ulepszy? silnik lub cokolwiek w db3 wyskakuje ?e event nie jest dodany do serverside a jest dodany
wszystkie kody:
[lua]function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
[lua]addEventHandler("onPlayerLogin",getRootElement(),function()
local query = exports["dbConnect"]:GdbQuery("SELECT * FROM `players` WHERE Login LIKE '"..tostring(getAccountName(getPlayerAccount(source))).."'")
local results = exports["dbConnect"]:GdbPoll(query,-1)
if results then
for i,v in ipairs(results) do
if getAccountName(getPlayerAccount(source))==v["Login"] then
local cid = v["CID"]
local money = v["Money"]
local peanuts = v["Peanuts"]
local LP = v["LP"]
local clothes = v["Clothes"]
local fraction = v["fraction"]
local lifecoints = v["LifeCoints"]
local bankmoney = v["Bankmoney"]
local premium_hours = v["Premium_hours"]
if fraction == "" then fraction = false end
--- PREMIUM
-- INNE
if money < 0 then money = 0 end
if peanuts < 0 then peanuts = 0 end
if LP < 0 then LP = 0 end
if clothes < 400 then clothes = 0 end
Witam. Mam problem z UID na serwerze. Nowy gracz nie dostaje odpowiedniego uid. Ja mam uid 1 (Sam ustawi?em), a nast?pny gracz dostaje 121,122 itd.
Baz? danych czy?ci?em ju? 2 razy i nadal to samo.
Tak samo jest z pojazdami.
Witam. Mam problem z UID na serwerze. Nowy gracz nie dostaje odpowiedniego uid. Ja mam uid 1 (Sam ustawi?em), a nast?pny gracz dostaje 121,122 itd.
Baz? danych czy?ci?em ju? 2 razy i nadal to samo.
Tak samo jest z pojazdami.
Witam mam problem z przechowywalni? jak robi? tuning maluje to auto daje je do przecho i wyjmuje to wszystko usuwa lub jak daje auto do przecho zepsute i je wyjme to jest naprawione prosze o pomoc daje
c_parking [lua]local screenW, screenH = guiGetScreenSize()
local marker=createMarker(-2048.17,346.43,35.13, "cylinder", 2, 255,255,255,50)
local sphere=createColSphere(-1743.54,955.78,24.48,5)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","OdbiĂłr pojazdĂłw")
setElementPosition(t,-2048.17,346.43,35.17)
addEvent("onParkingGetVehicles", true)
addEventHandler("onParkingGetVehicles", root, function(result)
guiGridListClear(wm.gridlist)
if not result then return end
for i,v in pairs(result) do
if...
Witam mam problem w kt?rym chodzi o to ?e po wej?ciu w marker nie dzia?aj? przyciski rozpocznij i informacje tylko dzia?a przycisk wyj?cia z gui nie wiem jak to naprawi? denerwuje mnie ju? to jakby kto? pom?g? to moge piwko zimne stawi?
[lua]kurierMarker = createMarker ( -2521.24561, -621.98376, 131.74370, "cylinder", 1, 0, 180, 160 )
kurier_glowny = false
kurier_informacje = false
kurier_rozpocznij = false
function isMouseInPosition ( x, y, width, height )
if ( not isCursorShowing( ) ) then
return false
end
local sx, sy = guiGetScreenSize ( )
local cx, cy = getCursorPosition ( )
local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
return true
else
return false
end
end
Witam kupi?em sobie serwer i chcia?em potestowa? wgra?em wszystko itp tylko jak sie zarejestruje to mam uid 2174 nwm jak to usunac ?eby jak pierwsza osoba sie zarejestruje mia?a uid 1 za pomoc daie
Bo , znalaz?em skrypt na licznik przerobi?em go (zmieni?em grafiki , po?o?enie ,itp)
i chcia?em go pod??czy? to systemu aut ?e by , m?g? pobra? warto?ci o przebiegu i paliwie.
Ale my?la?em ?e , si? uda a tu ni? .
local sw, sh = guiGetScreenSize();
local zoom = 1;
if sw < 1920 then
zoom = math.min(2, 1920/sw);
end
local function sx(po)
return (po/1920)*sw;
end
local function sy(po)
return (po/1080)*sh;
end
local font = dxCreateFont("cz.ttf", 14/zoom)
addEventHandler("onClientRender", root, function()
if getElementData(localPlayer, "hud") then return end
if getPedOccupiedVehicle(localPlayer) then
local przebieg = getElementData(veh,"vehicle:mileage") or 0
local veh = getPedOccupiedVehicle(localPlayer)
local paliwo = getElementData(veh, "vehicle:fuel") or 100
local sx2, sy2, sz2 = getElementVelocity(veh)
local predkosc = (sx2^2 + sy2^2 + sz2^2)^(0.5)
local kmh = predkosc * 180
local kmh2 = predkosc * 145
if getVehicleOverrideLights(veh) == 1 then
dxDrawImage(sx(1400), sy(586), sx(550), sy(550), ":licznik/licznik/bialy.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
else
dxDrawImage(sx(1400), sy(586), sx(550), sy(550), ":licznik/licznik/bialyon.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end
if getElementHealth(veh) < 301 then
setElementHealth(veh,302)
end
dxDrawImage(sx(1400), sy(620), sx(550), sy(550), ":licznik...
Siemka tak jak w temacie nie dzia?a mi z 4x4z i gwintowane zawieszenie.Mam paczk? PYS-A i gdy wchodz? do blipu z montowaniem mk i 4x4 to gdy wbieram opcje 4x4 to pisze ze mam odda? auto do przecho a potem jak wyci?gam to nie mam tego 4x4. I nie wiem jak doda? do gui mo?liwo?ci zamontowania rh. A jak dodaje rh w bazie danych to tylko mi pisze na czacie jak wyci?gam samoch?d ?e rh jest zainstalowanie a nie dzia?a.Nie wiem jak to naprawi?.
Witam mam problem gdy? jak auto jest zepsute i daje je do przecho potem wyjme je yo jest naprawione , gdy zrobie tuning pomaluje go itp dam go do przecho i wyjme to tak samo usuwa wszystko. Za pomoc daje
Po otwarciu panelu wszystko si? wy?wietla pr?cz tekstu, export jest poprawny, a w debugu czysto.
--server
[lua]
addEvent("dashboard:getPunish", true)
addEventHandler("dashboard:getPunish", root, function()
local uid=getElementData(source,"player:uid")
if not uid then return end
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM kartoteka WHERE typ=? and karajacy=? and data=? and powod=?", uid)
if #result > 0 then
triggerClientEvent(source, "dashboard:setPunish", source, result)
end
end)
[/lua]
--client
[lua]
for i, v in ipairs(tabelapunish) do
local sx=(25*h)*(i-21)
dxDrawText("Typ kary: #990033"..v[1].." #FFFFFF| Nadaj?cy kar?:#990033"..v[2].." #FFFFFF| Data na?o?enia kary: #990033"..v[3].." #FFFFFF| Pow?d: #990033"..v[4].."", screenW * 0.2359, sx, screenW * 0.7625, sx, tocolor(255, 255, 255, 255), 1.00*w, font, "center", "center", false, false, false, true, false)
end
end
addEvent("dashboard:setPunish", true)
addEventHandler("dashboard:setPunish", root, function(result)
if not result then return end
for i,v in pairs(result) do
if #tabelapunish > 31 then
table.remove(tabelapunish, 1)
...
Ustawi?em automatyczne IP i terminal wyplu? mi to:
Querying MTA master server... success! (Auto detected IP: 85.128.142.125)
Pr?bowa?em si? po??czy? poprzez to IP, natomiast na nic si? to nie zda?o. Poda?em r?wnie? IP serwera, no i po prostu nic si? nie dzia?o. Wszystko z tego co widzia?em zainstalowa?em poprawnie, zero b??d?w, wszystko zgrane. Tak?e o co chodzi? Jak mog? si? po??czy? z serwerem?
[ Dodano: 2018-08-07, 13:52 ]
Widz? problem - mam zablokowane porty. Jak je odblokowa?? Od razu m?wi?, ?e nie mam dost?pu do ?adnych boskich narz?dzi, bo nie stawiam serwera na routerze tylko na maszynie.
[color=red]Witam potrzebuje pomocy poniewa? nie dzia?a mi przechowywalnia (przerabiam przecho z pysa) do ko?ca nie moge schowa? pojazd?w nic sie nie da :C
o to kod
[/color]
s_parking.lua
[code]
--[[
addEventHandler("onResourceStart", resourceRoot,
function ()
CuboidNumber_0 = createColCuboid(-2006.5430908203, 478,99685668945, 48.540523529053, 14.4, 7.3, 6.2)
end
)
--]]
--[[
addEventHandler("onResourceStart", resourceRoot,
function ()
CuboidNumber_0 = createColCuboid(-2006.5430908203, 478-99685668945, 48.540523529053, 14.4, 7.3, 6.2)
end
)
--]]
local marker=createMarker(-2051.62, 490.59, 34.50-0.2, "cylinder", 6.4, 255,0,255,20)
createBlip(-2051.62, 490.59, 35.17, 35,2,0,0,0,0,0,250)
local mdestroy = createColCuboid(-2006.5430908203, 478.99685668945, 48.540523529053, 14.4, 7.3, 6.2)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","Pozostawianie pojazd?w")
setElementPosition(t,-2051.62, 490.59, 35.17)
addEvent("onParkingGetRekords", true)
addEventHandler("onParkingGetRekords", root, function()
local sid=getElementData(source,"player:sid")
if not sid then return end
local org = getElementData(source,"player:organization")
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_vehicles WHERE (ownedPlayer=? OR ownedGroup=?) AND parking=1",sid,org o...
witam pr?buj? odbugowa? paczke stories rpg i mam taki problem i? gdy? nie pojawia mi sie gui jak chce wystawic auto na gielde gdy auto jest zniszczone i wjade w market to jest napisane ze auto jest uszkodzone a jesli auto nie jest uszkodzone i wszystko jest okej gdy wje?d?am w marker nic sie nie pokazuje 0 reakcji tu macie kod
[quote]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w,h=(screenW/1680), (screenH/1050)
local font=dxCreateFont("f.ttf", 11)
local font2=dxCreateFont("f.ttf", 12)
local font3=dxCreateFont("f.ttf", 14)
local img=dxCreateTexture("i/sale.png")
function mysz(psx,psy,pssx,pssy,abx,aby)
if not isCursorShowing() then return end
cx,cy=getCursorPosition()
cx,cy=cx*sx,cy*sy
if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
return true,cx,cy
else
return false
end
end
local pokapoka=false
Witam mam problem z tym , ?e jak zaczn? prace kosiarek to ?eby w tym miejscu gdzie jest blip na mapie pokazywal sie krzak i jak sie przejedzie przez to to on sie usuwa i pokazuje nastepny za pomoc daje
function public1(plr, hitElement)
local public = createVehicle(496, -2417,588,133,0.0,360.0,89.6)
setElementData(public, "pojazd_opis", "Pojazd Publiczny")
setVehicleColor(public, 52, 1, 255 )
setElementData(public, "giveVehicleFuelOnSpawn")
end
addEventHandler("onMarkerHit", publicz , public1)
Pomorze ktos naprawic w konsoli nie ma bledu ale w grze wchodze w marker i nic sie nie dzieje mam ustawienie w meta client[/b]
Witam i? jestem pocz?tkuj?cy w lua nie wiem dlaczego nie kupuje i nie zabiera pieni?dzy gdy pr?buje kupi? fastfooda w budce. Dla jasno?ci jest to skrypt z New Place kt?rego przerobi?em pod sw?j serwer i wszystko ?adnie tylko nie chce sie kupi?. Prosi?bym o pomoc. Daje zimne piwko
Witam i? jestem pocz?tkuj?cy w lua nie wiem dlaczego nie kupuje i nie zabiera pieni?dzy gdy pr?buje kupi? fastfooda w budce. Dla jasno?ci jest to skrypt z New Place kt?rego przerobi?em pod sw?j serwer i wszystko ?adnie tylko nie chce sie kupi?. Prosi?bym o pomoc. Daje zimne piwko
Witam, przychodz? mo?e i ze zbyt prostym problemem, ale podczas nauki LUA nie mog? zamkn?? gui, a przycisk nie reaguje. GUI zrobione jest w dxdraw.
addEvent("okno",true) addEventHandler("okno", root, function(value)
if not value then return end
tekst = value
showCursor(true) addEventHandler("onClientRender", root, ostrzezenie)
function warnClose()
if isMouseIn(screenW * 0.5555, screenH * 0.5875, screenW * 0.1008, screenH * 0.0653) then -- miejsce buttona if value then
removeEventHandler("onClientRender", root, ostrzezenie) end
end
end
end)
isMouseIn jakby kto? potrzebowa?, ale jestem pewny, ?e to dzia?a:
function isMouseIn ( x, y, width, height )
if ( not isCursorShowing( ) ) then return false
end
local sx, sy = guiGetScreenSize ( ) local cx, cy = getCursorPosition ( ) local cx, cy = ( cx * sx ), ( cy * sy )
if ( cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then return true else
return false
end
end
" DB3: chats.lua:93: attempt to concatenate a boolean value "
Kod:
for i,v in pairs(players) do local id=getElementData(source,"id") outputChatBox("#1b52a6(#FFFFFF ID:"..getElementData(source,"id").."1b52a6 ) #FFFFFF"..getPlayerName(source)..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, , , _, true) end
addEventHandler("onClientRestore", root, function()
localPlayer:setData("player:minimalized", false)
if timer and timer.valid then timer:destroy() end
end)
addEventHandler("onClientRender", root, function()
if not isPlayerMapVisible() and not localPlayer:getData("player:hud_visible") then
local position = {getElementPosition(localPlayer)}
local city = getZoneName(position[1], position[2], position[3], t...