Mam problem z tworzeniem organizacji gdy chce ja stworzyc i wpisac nazwe organizacji i kliknac utw?rz, organizacja sie nie tworzy a w debugu wyskakuje taki owy b??d:
c_client.Jua:83: attempt to compare boolean with numb [DUP x4]
[code]--[[
unrealMTA @ 2020
autor zasobu: Chojnas
]]--
local sx, sy = guiGetScreenSize()
local zoom = sx < 1920 and math.min(2, 1920 / sx) or 1
Witam mam do was pro?b? m?g?by kto? sprawdzi? czy dobrze napisany jest ten skrypt bo co? mi nie dzia?a jak chc? stworzy? organizacj? co do bazy danych to mam wszystko podpi?te tabela i kolumny pod skrypt zrobione
tutaj macie skrypt:
addEvent('organization:create',true)
addEventHandler('organization:create',resourceRoot,function(name)
local check = exports['pystories-db']:dbGet('select * from ms_organizacje where code=?',name)
if check[1] then outputChatBox('Podana nazwa organizacji jest ju? zaj?ta!',client) return end
if string.len(name) < 3 then outputChatBox('Nazwa organizacji jest zbyt kr?tka.',client) return end
local create = exports['pystories-db']:dbSet('insert into ms_organizacje (code, login, uid, actived, rank) values(?,?,?,now(),4)',tostring(name),getElementData(client,'player:nickname'),getElementData(client,'player:sid'))
if create then
outputChatBox('Pomy?lnie stworzy?e? organizacj? o nazwie: '..name..'!',client)
setElementData(client,'player:organization',tostring(name))
takePlayerMoney(client,15000000)
else outputChatBox('Wyst?pi? b??d, zg?o? go administracji.',client) end
end)
Witam mam skrypt na zakladanie organizacji lecz gdy proboje ja zalozyc wyskakuje mi taki blad w db3
[code]ERROR: Client (#FF0000NoName) triggered serverside event zalozs, but event is not added serverside[/code]
c.lua
[lua]
--[[ GUI wykona?: DerricK. --]]
local font = dxCreateFont(":dG-Fonty/1.ttf", 10)
local blur = exports['blur']
mojeW,mojeH = 1280, 1024
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
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
Doda?em ulepszenie do organizacji kt?re ma zwi?ksza? zarobki w pracach, lecz co? mi nie dzia?a w tym kodzie, tak jakby ?le by? export zrobiony, w bazie danych ul1 ma warto?? 1
Jeszcze chce doda? ?e nawet je?li jestem w organizacji kt?ra ma ul1 r?wn? 1 daje mi normalna kwot? a nie x2
witam gdy probowalem zalozyc organizacje normalnie sie zalozyla lecz jak zreconnectowalem to juz nie wczytalo mi organizacji aktualnie wgralem paczke z psrpg 2.0 i dalej jest tak samo wie kto? mo?e dlaczego tego nie wczytuje? w bazie danych normalnie jest
Witam otoz mam skrypt z denvermta na organizacje mam wlaczone wszelkie dx editboxy lecz jak klikam f4 i wchodze w panel ustawienia spawnu org to sie nie pokazuje napis USTAW ponizej przesylam kod Nie ma zadnych bledow w db3
[lua]
local font = dxCreateFont("font1.ttf", 20)
local sx,sy = guiGetScreenSize()
local zoom = 1920/sx
local main = dxCreateTexture("i/main.png")
local arrow = dxCreateTexture("i/arrow.png")
local users = dxCreateTexture("i/users.png")
local dod = dxCreateTexture("i/dod.png")
Witam ostatnio wgralem skrypt na panel organizacji z denver mta lecz gdy klikam tam gdzie jest ustawianie respu org to mi wyskakuje taki b?ad w db3 i mi sie nie wyswietla napis Ustaw
ERROR: pystories-panelc.lua:127: attempt to concatenate field 'xyz' (a nil value) [DUP x39]
przesylam 127 linijke tego skryptu
Witam ot??, mam skrypt na org, wszystko git dzia?a zak?adanie itd. Jak wchodz? na serwer wszystko w mysql git si? zapisuje. Tylko gdy wbijam na serwer nie mam danej organizacji
kod na zapisy org
s_saveplayer.lua
[lua]--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]
function getPremium(plr,premium)
if premium then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premium=?",getElementData(plr,"player:uid"), premium)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
if result and #result > 0 then
return true
else
return false
end
end
end
function loadPlayerData(plr)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
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...
Witam wie kto? mo?e gdzie znajduje si? kod odpowiadaj?cy za player:organization:spawn. Poniewa? gdy klikam spawn organizacji to mimo to ze mam ustawiony spawn to respi na spawnie ;/.
Witam przychodze z problem, i? normalnie moge dodac auto do organizacji kazdy moze jezdzic ale gdy odpuszam organizacje lub mnie wyrzuca to moje auta sa dalej do niej przypisane i kazdy wciaz moze z nich korzystac. Za pomoc daje piwka
KOD
[lua]local zaproszenia = {}
local max_people_in_org = 55 ---- 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:sid") == 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["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=?", text)
if not result1 or #result1 < 0 then outputChatBox("* Podany u?ytkownik nie istnieje w baz...
Witam, mam problem z zak?adaniem organizacji. Ot?? problem wygl?da tak: zak?ada j? i tworzy w ogrpg_organization_list, a w ogrpg_organizations daje rang? 99 ale nie ustawia code, kt?re powinno by? takie same jak w ogrpg_organization_list. Za pomoc I
addEventHandler("onClientGUIClick", root, function(btn,state)
if source == wm.submit then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
if selectedRow < 0 then return end
local id=tostring(guiGridListGetItemText(wm.gridlist, selectedRow, 1))
local name=tostri...
Witam mam problem chodzi o to ze mam tu kod na wczytywanie Zapisu gracza i jest tu GOLD/Premium/Organizacje i GOLD i Premium dza?a normalnie ale organizacje nie,
Organizacje s? na koncu w kodzie I jak dam na pocz?tek to Premium nie dza?a Nie ma b??d?w w debugscript3 Oraz Wszystko jest po??czone bo dza?a?o
[lua]
function loadPlayerData(plr)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
setElementData(plr,"player:logged",true)
setElementData(plr,"player:mandate",v.mandate)
setElementData(plr,"player:license:pjA",v.pjA)
setElementData(plr,"player:license:pjB",v.pjB)
setElementData(plr,"player:license:pjC",v.pjC)
setElementData(plr,"player:license:pjL",v.pjL)
setElementData(plr,"player:reputation",v.reputation)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
setElementData(plr,"player:skin",v.skin)
local queryB=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND golddate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
local re...
dbExec(handler, "CREATE TABLE IF NOT EXISTS 'organizacje' (organizacja TEXT, wlasciciel TEXT, r INTEGER, g INTEGER, b INTEGER)")
function org()
local query = dbQuery(handler, "SELECT * FROM organizacje")
local result, num_rows, errormsg = dbPoll (query, -1)
for i,v in pairs(result) do
local team = createTeam(v["organizacja"] ,tonumber(v["r"]), tonumber(v["g"]), tonumber(v["b"]))
if team then
setElementData(team, "wlasciciel", v["wlasciciel"])
setPlayerTeam(, team)
end
end
end
addEventHandler("onResourceStart", getRootElement(), org)
function zapiszOrg()
for i,v in pairs(getElementsByType("team")) do
local owner = getElementData(v, "wlasciciel")
if owner then
local r, g, b = getTeamColor(v)
local team = getTeamName(v)
dbExec(handler, "INSERT INTO 'organizacje' (organizacja, wlasciciel, r, g, b) VALUES (?,?,?,?,?)", team, owner, r, g, b)
end
end
end
setTimer(zapiszOrg, 5000, 0)
addEventHandler("onResourceStop", getRootElement(), zapiszOrg)
function asd(plr, cmd, team, r, g, b)
if team and r and g and b then
local team = createTeam(team, r, g, b)
setElementData(team, "wlasciciel", getPlayerName(plr))
outputChatBox("Stworzyles team o na...
W ko?cu uko?czy?em ten system na takim poziomie, ?eby m?c go wam udost?pni?. Skrypt oznaczam wersj? 0.5, oznacza to, ?e nie jest to ko?cowy wynik. Chcia?bym ?eby?cie pomogli mi go przetestowa?, a je?eli komu? odpowiada w takim stanie to mo?e ju? go u?ywa?(zreszt? na tym poziomie jest to mo?liwe). Piszcie swoje uwagi, informacje o bugach, b??dach, swoje propozycje.
Podstawowe komendy:
[code]
/gorg - cmd gracza
/aorg - cmd organizacji admina(rcon)
/lorg - cmd lidera
/rorg - cmd rang admina(rcon)
[/code]
Wyprzedzam pytania o GUI - tak b?dzie, jednak teraz chcia?bym skupi? si? na wersji "surowej" i na mo?liwych b??dach.
Jak na razie nie wykorzystuje jeszcze mo?liwo?ci konta w organizacji oraz tytu?u za?o?yciela, wykorzystam je w najbli?szych poprawkach. Po prostu musz? wymy?li? odpowiednie zastosowanie. Mia?em ju? pewne, jednak zaniecha?em go podczas pisania skryptu.
.pwn, .amx, include, pluginy, inne pliki potrzebne do uruchomienia znajdziecie pod adres...