Witam, aktualnie mam zamiar stworzyc autorski projekt i podczas tworzenia, przy robieniu panelu logowania po rejestracji w DB nadaje mi UID 0 zamiast 1 i po stworzeniu paru kont zauwazylem, ze wszystkim nadaje UID 0 zamiast 1 2 3 4 5 itp
prosze o pomoc, w bazie danych UID mam ustawione jako int(11)
Witam ot?? mam problem gdy? nie tworzy si? item po jego wywaleniu (dostarcza itemName2 bo sprawdza?em po przez wiadomo?? na czacie). Stawiam zimne Piwerko
Cze?? mam problem z tune mechanicznym z gm crpg dok?adnie problem istnieje w tym ?e jak chce co? kupi? to nie pobiera pieni?dzy i nie jest dodane do pojazdu.
DB3: [img]https://imgur.com/a/gD6ZCmF[/img]
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]
addEvent("mTuning", true)
addEventHandler("mTuning", root, function(v, i, c)
if not v and not i and not c then return end
local hand = getVehicleHandlingProperty(v, "driveType")
local hajs = getElementData(source, "pieniadze")
local bak = getElementData(v, "bak")
bak = tonumber(bak)
if i == "Zawieszenie hydrauliczne" then
if getElementData(v, "zawieszenie") then
local cx = c/2
cx = string.format("%1.2f", cx)
setElementData(source, "pieniadze", hajs+cx)
exports["nm-noti"...
witam pomoze mi ktos ? gdy wgrywam radar z paczki stories rpg pod pysa to mi nie dziala nie wyswietla sie tu kod
[code]local enableBlips = true
local renderNorthBlip = true
local alwaysRenderMap = false
local worldW, worldH = 3072, 3072 --map image dimensions - if map image changed, please edit appropriately
local blip = 12 --Blip size, pixels relative to 1366x768 resolution
------------------------------------------------------------------------------------
--Do not modify anything below unless you're absolutely sure of what you're doing.--
------------------------------------------------------------------------------------
local sx, sy = guiGetScreenSize()
local rt = dxCreateRenderTarget(290, 175)
local xFactor, yFactor = sx/1366, sy/768
local yFactor = xFactor --otherwise the radar looses it's 2:3 ratio.
local w, h=(sx/1680), (sy/1050)
-- Useful functions --
function findRotation(x1,y1,x2,y2) --Author: Doomed_Space_Marine & robhol
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;
end
function getPointFromDistanceRotation(x, y, dist, angle) --Author: robhol
local a = math.rad(90 - angle);
local dx = math.cos(a) * dist;
local dy = math.sin(a) * dist;
return x+dx, y+dy;
end
function drawRadar()
if not getElementData(localPlayer,"player:logged") then return end
if getElementData(localPlayer,"hud:visible") then
setPlayerHudComponentVisible(&qu...
Siema mam tutaj taki kod z ITS'a i nie wiem dla czego /tt /vth itd. nie dzia?a.
Szuka?em b??d?w w kodzie ale nic nie znalaz?em.
Je?li kto? ma dzia?aj?cy to prosze.
[lua]addCommandHandler("kick", function(plr,cmd,cel,...)
if getAdmin(plr,4) or getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1) then
local reason = table.concat({...}, " ")
if not cel or not reason then
outputChatBox("* U?ycie: /kick <nick/ID> <pow?d>", plr)
return
end
local target = exports["ogrpg-core"]:findPlayer(plr,cel)
if not target then
triggerClientEvent(plr, "iyw_notifications:send", plr, "error", "Nie znaleziono podanego gracza.")
return
end
exports["ogrpg-db"]:dbSet("insert into kartoteka (typ,karajacy,data,powod,ofiara) VALUES(?,?,NOW(),?,?)", "KICK", plr.name:gsub("#%x%x%x%x%x%x",""), reason, getElementData(target, "player:uid"))
triggerClientEvent(root, "adminRender", root, "Gracz "..getPlayerName(target).." zosta? wyrzucony przez "..plr.name..", pow?d: "..reason.."")
exports["ogrpg-db"]:dbSet("INSERT INTO admin_logs_cmd (uid,moderator,cmd) VALUES (?,?,?)", getElementData(plr,"player:uid"), plr.name:gsub("#%x%x%x%x%x%x",""), "kick "..getPlayerName(target).."")
kickPlayer(target, plr, r...
na moim serwerze nie dziala brama
ta pierwsza dziala ale ta druga juz nie(ta druga z dopiskiem 1 nie dziala)
[lua]
local gate={
-- var
object=createObject(969, 1544.70,-1630.85,12.51,0,0,90),
marker=createMarker(1544.29,-1626.99,13.38-1, "cylinder", 9, 0, 0, 0, 0),
close=true,
animation=false,
}
gate.open=function()
if gate.animation or not gate.close then return end
Witam ot?? mam problem z Triggerem eventu do clienta (gracza) ten napis "przeprzekroczy?es limit" dzia?a. Stawiam Piwerko
kod do wysylania eventu:
function newObject(thePlayer)
if maxobjectysciany[client] >= 5 then
outputChatBox("przekroczy?es limit", client) triggerClientEvent (thePlayer, "wylgui", thePlayer) end
end
addCommandHandler("spr",newObject)
odbi?r eventu od servera:
addEvent("wylgui",true)
function wylaczgui () guiSetVisible(baseCPanel.window[1], not guiGetVisible ( baseCPanel.window[1] )) showCursor ( false ) end
addEventHandler("wylgui", root, wylaczgui)
Witam mam problem z sprawdzaniem dw?ch if`?w kt?re s? poni?ej a chce, aby dziala? skrypt kt?ry jest oznaczony *(Nie ma b??d?w w db3). Stawiam Piwerko
(Tiggery mam po stronie clienta, bo gdy mam sam if model == 3260 then... to dziala, a jak z tym ranga == "Founder" to nie dziala )
dwa if`y: (* to niedzia?a, chce ?eby dziala?)
local objekty = {}
function newObject(model,player) local ranga = exports.Skrypt2:getPlayerGroupRank(player)
if model == 3260 and ranga == "Founder" then
objekty[client] = objekty[client]+1
end
addEvent("addon.basecreator:newObject", true) addEventHandler("addon.basecreator:newObject", root, newObject)
jeden if: (dziala)
function sprawdzenie(player) local ranga = exports.Skrypt2:getPlayerGroupRank(player)
if ranga == "Founder" then
outputChatBox("dziala", player) end
end
addCommandHandler("spr2", sprawdzenie)
jeden if: (dziala)
local objekty = {}
function newObject(model)
if model == 3260 then
objekty[client] = objekty[client]+1
end
addEvent("addon.basecreator:newObject", true) addEventHandler("addon.basecreator:newObject", root, newObject)
witam mam koszary z gtao (model) wykonany przez Garru i chcialem przeniesc to do mta i w tym celu napisalem mete i client.lua client jest o tresci:
local txd = engineLoadTXD("safd.txd") engineImportTXD(txd, 17551) local dff = engineLoadDFF("safd.dff", 17551) engineReplaceModel(dff, 17551) local col = engineLoadCOL("safd.col") engineReplaceCOL(col, 17551)
Witam mam mianowicie problem kiedy chce dodac tak? funkcj?:
function cmd_blokada(plr)
if getElementData(plr, "mutespamer") == 2 then return end
setElementData(plr, "mutespamer", 2) setTimer(function() setElementData(plr, "mutespamer", false) end, 3000, 1)
Do komendy -
addCommandHandler('do', function(source, cmd, ...) local text=table.concat({...}, ' ')
if not text then return end if ninjaban(text) then
triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source).."("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez system. Powod: Reklama") kickPlayer (source, "System:Reklama")
return end
local msg=table.concat({...}, " ") local x,y,z=getElementPosition(source) local sphere=createColSphere(x,y,z, 30) local players=getElementsWithinColShape(sphere, 'player') destroyElement(sphere)
for i,v in ipairs(players) do outputChatBox("*(( "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg.."))", v, 255, 51, 102) triggerClientEvent("onDebugMessage", resourceRoot, "*(( "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg.."))",1, "/ME") end
end)
-- Functions function dbSet(...)
if not {...} then return end
local query=dbExec(DBHandler, ...)
return query
end
function dbGet(...)
if not {...} then return end
local query=dbQuery(DBHandler, ...) local result=dbPoll(query, -1)
return result
end
addEventHandler("onResourceStart", resourceRoot, function() DBHandler=dbConnect("mysql", "dbname="..DBName..";host="..DBHost.."", DBUser, DBPass, "share=1")
if DBHandler then
outputDebugString("* Connect to server MYSQL...")
else outputDebugString("* No Connecting to server MYSQL..") end
end)
Oczywiscie luki dbPass itp sa dobrze wypisane tylko tutaj tak zrobilem bo nie chce podawac danych
blad w db3: fire-db/s_db.lua:18: dbPoll failed; You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' fire-admin WHERE serial="mojserial" at line 1
Witam, pisze dashboard ale nie dziala, po kliknieciu w dane miejsce nie pokazuje img menu postaci
kod:
[lua]--[[
Info Author: flyBoi_
For resource: InvisibleGame
All rights reserved by InvisibleGame and flyBoi_
----------------------------------------------------
Info Autor: flyBoi_
Dla zasob?w: InvisibleGame
Wszystkie prawa zastrze?one przez InvisibleGame i flyBoi_
]]--
local amercian10 = dxCreateFont("font/american.ttf", 10)
local sx, sy = guiGetScreenSize()
wlaczone = false
aktualnie = glowna
function isMouseIn(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
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if wlaczone == true then
if isMouseIn(20/1780*sx, 250/1780*sy, 180/1780*sx, 60/860*sy) then
aktualnie = postac
end
end
end
end)
addEventHandler("onClientRender", root, function(plr)
if wlaczone == true then
if aktualnie == glowna then
dxDrawImage(0/1780*sx, 0/860*sy, 1780/1780*sx, 860/860*sy, "img/db_glowna.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
--dxDrawRectangle(20/1780*sx, 250/1780*sy, 180/1780*sx, 60/860*sy, tocolor(255, 0, 0, 180)) -- to bylo pomoc...
Witam, pisze skrypt aby po napisaniu komendy tworzyl sie 3dtext, ale nie dzia?a kod:
addCommandHandler("dodaj.opis", function(...) local tresc = table.concat(arg, " ") local x, y, z = getElementPosition(plr) local t = createElement(text) setElementData(t, "name", ""..tresc.."") setElementPosition(t, x, y, z) end)
Db3:
invalid value (userdata) at index 1 in table for 'concat'.
//Znacznik lua sie zepsul i pokazuje jakies &58745 (tego nie ma w kodzie)
Witam, wgra?em wszystko z IT'S YOUR WORLD na ftp a nastepnie importowalem baze danych i wszytko poszlo pomyslnie, w DB2 i ogp-db edytowalem na moje dane do mysql i po wejsciu na serwer jak klikam zarejestruj sie to jest napisane ze pomyslnie zarejestrowano ale jak dam zaloguj potem to mam ze nie ma takiego w bazie, a gdy wpisze jakis nick z bazy danych z tabelki user to pokazuje ze zle haslo wiec wydaje mi sie ze gdy robie zarejestruj te konto nie zapisuje sie w bazie danych w tym user i mam pytanie i prosbe jak to naprawic bo utkna?em na logowaniu. Dzi?kuje z g?ry za pomoc.
Dobry dzia? ?
i jest jeden problem bo jak pr?buje sprzedac komus auto to pisze ze nie znaleziono podanego gracza:
Kod:
[lua] local LIMIT=300 -- tylko gracz mo?e kupi? trzy pojazdy
local cmd="sprzedaj.pojazd"
local cmd2="akceptuj"
local sprzedazPojazdu={}
marker2=nil
local timer=nil
local pozycjeMarkerowv2={
-- Opis nad markerem, x,y,z, int, dim
{"Gie?danSprzeda? pojazd?w", 2169.53, 1416.61, 10.82},
}
for i,v in pairs(pozycjeMarkerowv2) do
mkr=createMarker(v[2], v[3], v[4]-0.90, "cylinder", 2, 255, 11, 11, 125)
setElementDimension(mkr2, v[6] or 0)
setElementInterior(mkr2, v[5] or 0)
marker2=mkr
local t=createElement("text")
setElementData(t,"name",v[1])
setElementPosition(t,v[2],v[3],v[4])
setElementDimension(t, v[6] or 0)
setElementInterior(t, v[5] or 0)
end
function checkVehiclePlayer(plr)
-- Pobieramy tabel? i nast?pnie zwracamy j?
local result=exports["og-db"]:getRekord("SELECT * FROM og_vehicles")
local number=0
-- Uruchamiamy p?tl? spradzaj?c? pojazdy z bazy danych i
-- por?wnujemy w?a?ciciela z UID osoby kt?ra chce zakupi?
for i,v in ipairs(result) do
if result[1].ownedPlayer == getElementData(plr,"player:uid") then
number=number+1
end
end
-- Zwracamy ilo?? pojazd?w gracza je?eli nie ma zwr?ci
-- mu false.
return number
end
local function pokazOperacje(plr)
if not sprzedazPo...
Sci?g?em skrypt na rejestracje i jak nacisam stworz postac to nie ma zadnej reakcji.
Prosz? o to wyci?g z konsoli.
Je?li kto? chce pom?c moge podac haslo do ftp.
Wyci?g z konsoli:
[code][2018-03-12 15:56:22] Some files in 'lss-tempomat' use deprecated functions.
[2018-03-12 15:56:22] Use the 'upgrade' command to perform a basic upgrade of resources.
[2018-03-12 15:56:22] SyncMapElementData is now disabled
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:4: Bad argument @ 'createPed' [Expected bool at argument 6, got number '225']
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:7: Bad argument @ 'setElementDimension' [Expected element at argument 1, got boolean]
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:8: Bad argument @ 'setElementInterior' [Expected element at argument 1, got boolean]
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:9: Bad argument @ 'setElementFrozen' [Expected element at argument 1, got boolean]
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:10: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]
[2018-03-12 15:56:22] WARNING: [XyzzyRP]/[obiekty]/gracz-sklep_super_sam/sklep.lua:11: Bad argument @ 'setElementData' [Expected element at argument 1, got boolean]
[2018-03-12 15:56:22] INFO: obiektow: 326
[2018-03-12 15:56:22] ERROR: [XyzzyRP...
Sciaglem skrypt od Haze. , ale po odpaleniu tego wyskakuje mi takie cos:
[2018-03-06 20] start: Requested by Console
[2018-03-06 20] Starting autostart
[2018-03-06 20] ERROR: autostart/server.lua:16: bad argument #1 to 'lower' (string expected, got nil)
[2018-03-06 20] start: Resource 'autostart' started
Pomo?e kto? ?
KOD:
tag = getResourceInfo ( getThisResource(), "tag" ) tag = tostring(tag) addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), function()
for k,v in ipairs(getResources()) do
if string.find(getResourceName(v), tag) or string.lower(string.find(getResourceName(v), tag)) or string.upper(string.find(getResourceName(v), tag)) then
stopResource(v) outputDebugString(getResourceName(v).." stopped.") end
end
end)
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function()
for k,v in ipairs(getResources()) do
if string.find(getResourceName(v), tag) or string.lower(string.find(getResourceName(v), tag)) or string.upper(string.find(getResourceName(v), tag)) then
startResource(v) outputDebugString(getResourceName(v).." started.") end
end
end)
Witam. mam problem z przecho z Owna a mianowicie jak dodam kolejne przecho to one nie chc? dzia?a?. jak doda? kolejne przecho tak by ono dzia?a?o i mo?na by?o odda? auto do przecho. Narazie jak mam tabele "przechowalnie" to tylko pierwsza dzia?a czyli LS a FC ju? nie dzia?a.
Witam, posiadam problem z systemem pojemno?ci w pojazdach. Mianowicie zapisuj? si? one w bazie danych, lecz na serwerze do pojazd?w nie dodaj? si? ?aden handling.
Mo?e tutaj kto? b?dzie w stanie odszuka? b??d w skrypcie/skryptach.
Poni?ej wrzucam kody:
pojemnosc.lua
[code]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 lalal(vehicle)
local pojemnosc = getElementData(vehicle,"vehicle:pojemnosc")
local engineacc = getVehicleHandlingProperty(vehicle,"engineAcceleration")
local maxspeed = getVehicleHandlingProperty(vehicle,"maxVelocity")
if getElementData(vehicle, "vehicle:pojemnosc") == 1 then
setElementData(vehicle, "vehicle:pojemnosc", 1.2)
setVehicleHandling(vehicle, "maxVelocity", velocity+3)
setVehicleHandling(vehicle, "engineAcceleration", acceleration+1)
elseif getElementData(vehicle, "vehicle:pojemnosc") == 2 then
setElementData(vehicle, "vehicle:pojemnosc", 1.4)
setVehicleHandling(vehicle, "maxVelocity", velocity+3.5)
setVehicleHandling(vehicle, "engineAcceleration", acceleration+1.25)
elseif getElementData(vehicle, "vehicle:p...
[center]Witam mam problem z CollidableWith. Mianowicie chdzi mi o to ze chce zrobic aby pojazdy przenikaly przez siebie w pracy.. Ale po dodaniu funkcji CollidableWith nie tepa gracza do pojazdu. Kod jest robiony po stronie serwera. Za pomoc daje i
Kod:
[lua]local m1 = createMarker(1227.81,181.58,20.41-1, "cylinder", 1.5, 0, 138, 255, 0)
local t = createElement('text')
setElementData(m1, "custom_prace", true)
setElementPosition(t, 1227.81,181.58,20.41+1.2)
setElementData(t,"name","Praca DorywczanKierowca AutobusunZarobek: 150PLN")
local vehs = {}
local code = "Autobusy"
local zone = createColCuboid(1178.59167, -1806.40845, 12.57031, 8.710205078125, 25.461059570313, 4.6140350341797)
local linie = {2,4,8}
addEventHandler("onMarkerHit", m1, function(el, md)
if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if getElementData(el,"player:job") then return end
if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
local x,y,z = getElementPosition(el)
local autbus = createVehicle(431, 1220.41,190.85,19.98,354.6,360.0,336.4)
setElementFrozen(el,true)
local linia = math.random(1,#linie)
setElementData(autbus, "vehicle:linia",linie[linia])
setElementData(autbus, "vehicle_job_owner", el)
...
Witam mam problem z outputChatBox'em w pewnej pracy. Jak zaczne prace to po prostu outputChatBox nie dziala... daje wam kawalek kodu moze cos wam uda sie wywnioskowac, dla czego nie ma tego outputChatBoxa.
Kod:
function nielegalna (theplayer)
if getElementData (theplayer, "oddalall") == true then
local pojazd = createVehicle (482, -1723.16,-85.07,3.68,359.2,0.2,132.6) warpPedIntoVehicle (theplayer, pojazd) setVehiclePlateText (pojazd, "DOSTAWCA") setVehicleColor (pojazd, 0, 0, 0) setElementData (pojazd, "vehicle:desc", "Praca NIE LEGALNA") addVehicleUpgrade (pojazd, 1025) setElementData (theplayer, "oddalall", false) setElementData (theplayer, "dojazdnielegalna", true) outputChatBox ("* Wybra?es prace nie legaln?! Udaj sie do pistoletu na mapie!", theplayer, 255, 255, 255) end
Siema robie serwer zabawy i pisalem skrypt na duty chatmoda i nie dziala
Wiecie w czym problem?
function zalogDuty(plr, cmd) local accName = getAccountName (getPlayerAccount (plr))
if accName then if isObjectInACLGroup("user."..accName, aclGetGroup("chatmod")) then
setElementData(plr, "gracz:dutycm") giveWeapon(plr, 28, 100) setElementHealth(plr, 100) end
outputChatBox("****Gratulacje zalogowac, chatmoda! Powodzenia", plr)
else outputChatBox("Niestety, nie jestes uprawniony", plr) end
end
end
addCommandHandler("dutycm", zalogDuty)
Prosze powiedzcie mi co tu jest zle bo nie mam sil (chcialbym aby na komende /praca usuwaly sie te wszystkie elementy)
function praca ( praca )
if getElementData(source,"AGJob") == "postman" then
local player = getPlayerFromName(getElementData(source,"JobOwner"))
if isElement(ptVehicle[player]) then
destroyElement(ptVehicle[player])
end
if isElement(ptVehicleBlip[player]) then
destroyElement(ptVehicleBlip[player])
end
if isElement(ptJobMarker[player]) then
destroyElement(ptJobMarker[player])
end
if isElement(ptJobBlip[player]) then
destroyElement(ptJobBlip[player])
end
if isElement(newMarker[player]) then
destroyElement(newMarker[player])
end
if isElement(nMBlip[player]) then
destroyElement(nMBlip[player])
end
ptNumber[player] = nil
setElementData(player,"AGJob",nil)
setElementModel (player, "0",nil)
end