Wysłany: 2020-04-18, 20:49
RAPsy
Wiek: 26 Na forum: 2489 dni Posty: 11
Nick w MP: Cieciu
Piwa : 15
Ostatnio zmieniony przez RAPsy 2020-04-19, 13:33, w całości zmieniany 1 raz
Wysłany: 2020-04-19, 00:43
Maniekxx
Amator
Wiek: 24 Na forum: 2894 dni Posty: 232
Nick w MP: Maniekxx
Piwa : 225
Jakie? b??dy w DB3? (/debugscript 3) SS nie dzia?a.
Wysłany: 2020-04-20, 10:27
Mezo.
Mod-Team
Wiek: 24 Na forum: 3211 dni Posty: 548
Nick w MP: Mezo
Piwa : 6070
Pode?lij najlepiej kod bo pewnie co? jest z interiorem markeru. Linijka 11,12,16,17 a najlepiej podaj ca?y kod.
Wysłany: 2020-04-20, 13:17
RAPsy
Wiek: 26 Na forum: 2489 dni Posty: 11
Nick w MP: Cieciu
Piwa : 15
Kod: local pointsMarkers={
{"SAPD", 1,1440.65, 1205.30, 129.45, 0, 1},
{"SAFD", 1,-1710.12, 385.04, 12.68, 0},
{"SAMC", 1, -5240.28, -357.71, 3.17},
{"TSA", 1, -2523.22, 1215.92, 37.43, 0},
}
for i,v in ipairs(pointsMarkers) do
local marker=createMarker(v[3], v[4], v[5]-1, "cylinder", 1.2, 255, 0, 0,255)
setElementData(marker,"marker:id",tonumber(v[2]))
setElementInterior(marker, v[6])
setElementDimension(marker, v[7])
setElementData(marker,"marker:faction",v[1])
local t=createElement("text")
setElementPosition(t,v[3],v[4],v[5])
setElementInterior(t, v[6])
setElementDimension(t, v[7])
setElementData(t,"name","Zarz?dzanie Frakcj?\n"..v[1])
end
addEvent("lider:editUser", true)
addEventHandler("lider: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 bazie danych.", client, 255, 0, 0) return end
local result2=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;", faction, text) -- pobieramy tylko JEDEN rekord
if not result2 or #result2 < 0 then outputChatBox("*Podany u?ytkownik nie znajduje si? w tej frakcji !",client,255,0,0) return end
local query1=exports["pystories-db"]:dbSet("UPDATE `pystories_factions` SET `rank`=? WHERE `sid`=? AND `code`=?", rank, text, faction)
if query1 then
local resulted=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=?", faction)
triggerClientEvent(client,"lider:refresh",resourceRoot,resulted)
outputChatBox("* Pomy?lnie zmieniono rang? graczowi "..result1[1].login.." we frakcji o id: "..faction.." na "..rank, client)
end
end)
addEvent("lider:addUser", true)
addEventHandler("lider:addUser", resourceRoot, function(text,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 bazie danych.", client, 255, 0, 0) return end
local result2=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE sid=? and code=?", text, faction)
if result2 and #result2 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w tej frakcji.", client, 255, 0, 0) return end
local result3=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE sid=?", text)
if result3 and #result3 > 0 then outputChatBox("* Podany u?ytkownik ju? znajduje si? w innej frakcji.", client, 255, 0, 0) return end
outputDebugString("Faction: "..faction)
outputDebugString("Text: "..text)
local query1=exports["pystories-db"]:dbSet("INSERT pystories_factions (sid,code,nickGracza) VALUES (?,?,?)", text, faction, result1[1].login)
if query1 then
local resulted=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=?", faction)
triggerClientEvent(client,"lider:refresh",resourceRoot,resulted)
outputChatBox("* Pomy?lnie dodano gracza "..result1[1].login.." o SID: "..text.." we frakcji na 1 poziom.", client)
end
end)
addEvent("lider:deleteUser", true)
addEventHandler("lider:deleteUser", resourceRoot, function(text,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 bazie danych.", client, 255, 0, 0) return end
local result2=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;", faction, text) -- pobieramy tylko JEDEN rekord
if not result2 or #result2 < 0 then outputChatBox("* Podany u?ytkownik nie znajduje si? w tej frakcji !",client,255,0,0) return end
local query1=exports["pystories-db"]:dbSet("DELETE FROM pystories_factions WHERE sid=? AND code=?",text, faction)
if query1 then
local resulted=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=?", faction)
triggerClientEvent(client,"lider:refresh",resourceRoot,resulted)
outputChatBox("* Pomy?lnie usunieto gracza "..result1[1].login.." o UID: "..text.." z frakcji." , client)
end
end)
addEventHandler("onMarkerHit", resourceRoot, function(el,md)
if not md or getElementType(el) ~= "player" then return end
local code=getElementData(source,"marker:faction")
if not code then return end
local sid=getElementData(el,"player:sid")
if not sid then return end
if not getElementData(el,"player:duty") then outputChatBox("* Najpierw wejd? na s?u?b?!",el) return end
if getElementData(el,"player:duty") ~= code then outputChatBox("* Nie jeste? na s?u?bie lub nie posiadasz uprawnie?.",el) return end
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=? AND sid=? LIMIT 1;", code, sid) -- pobieramy tylko JEDEN rekord
if result and #result > 0 then
if result[1].rank ~= 99 then outputChatBox("* Brak uprawnie? do panelu lidera!",el) return end
local resulted=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE code=?", code)
triggerClientEvent(el, "lider:showGUI", resourceRoot,code, resulted)
end
end)
Wysłany: 2020-04-20, 15:38
Maniekxx
Amator
Wiek: 24 Na forum: 2894 dni Posty: 232
Nick w MP: Maniekxx
Piwa : 225
Nie masz uzupe?nionych wszystkich argument?w w tabeli dlatego setElementInterior w 2 argumencie dostaje nil. Ostatnie 2 argumenty oznaczaj? Interior oraz Dimension w kt?rym znajduje si? marker.
Wysłany: 2020-04-22, 16:35
Maniekxx
Amator
Wiek: 24 Na forum: 2894 dni Posty: 232
Nick w MP: Maniekxx
Piwa : 225
{ "SAPD" , 1 , 1440.65 , 1205.30 , 129.45 , 0 , 1 },
{ "Kod frakcji" , id markera , pozycja x , pozycja y , pozycja z , interior , dimension }
-- Czyli po kolei
v [ 1 ], v [ 2 ], v [ 3 ], v [ 4 ], v [ 5 ], v [ 6 ], v [ 7 ]
{ "SAFD" , 1 ,- 1710.12 , 385.04 , 12.68 , 0 }, -- Tu nie masz wszystkich argument ? w ( Brak 7 )
{ "SAMC" , 1 , - 5240.28 , - 357.71 , 3.17 }, -- Tu nie masz wszystkich argument ? w ( Brak 6 oraz 7 )
{ "TSA" , 1 , - 2523.22 , 1215.92 , 37.43 , 0 }, -- Tu nie masz wszystkich argument ? w ( Brak 7 )
--[[ Teraz musisz sobie to wszystko uzupe ? ni ? --]]
Tagi: nie :: dziala :: panel :: frakcji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: