local gate = createObject ( 3089, 1089.0999755859, 2374.8999023438, 11.10000038147, 0, 0, 270 )
function open()
moveObject (gate, 1000, 1089.0999755859, 2376.3999023438, 11.10000038147 )
local query = ("SELECT * FROM tabela WHERE id=? AND frakcja=?" ,idGraczaWBazie ,"KGPLV")
local result = exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_factions WHERE uid=?", uid)
if #result>0 then-- ma dost?p
moveObject ( gate, 2000, 1089.0999755859, 2374.8999023438, 11.10000038147)
else return end
end
local query = ("SELECT * FROM tabela WHERE id=? AND frakcja=?" ,idGraczaWBazie ,"KGPLV")
w tej linijce podmieniasz nazwy tabeli oraz kolumny.. oraz "idGraczaWBazie", ja ci nie pomog? bo nie wiem jakie masz element daty w skrypcie, oraz tabele
local gate = createObject ( 3089, 1089.0999755859, 2374.8999023438, 11.10000038147, 0, 0, 270 )
function open()
moveObject (gate, 1000, 1089.0999755859, 2376.3999023438, 11.10000038147 )
local query = ("SELECT * FROM tabela WHERE id=? AND frakcja=?" ,idGraczaWBazie ,"KGPLV")
local result = exports["ogrpg-db"]:dbGet(query)
if #result>0 then-- ma dost?p
moveObject ( gate, 2000, 1089.0999755859, 2374.8999023438, 11.10000038147)
else return end
end
w local query zamie? sobie 'tabela' na swoja tabele z graczami w mysql, id oraz frakcja na swoje kolumny z id gracza w bazie oraz nazw? frakcji, idGraczaWBazie to jest id/uid gracza.
I powiedz jakim evetem otwierasz t? bram?. Komend? czy np markerem
local gate = createObject ( 3089, 1089.0999755859, 2374.8999023438, 11.10000038147, 0, 0, 270 )
function open()
moveObject (gate, 1000, 1089.0999755859, 2376.3999023438, 11.10000038147 )
local query = ("SELECT * FROM ogrpg_factions WHERE id=? AND frakcja=?" ,player:id ,"KGPLV")
local result = exports["ogrpg-db"]:dbGet(query)
if #result>0 then-- ma dost?p
moveObject ( gate, 2000, 1089.0999755859, 2374.8999023438, 11.10000038147)
else return end
end
Je?li to ogrpg to powinno dzia?a?
[ Dodano: 2017-06-21, 13:45 ]
Prosze o przerobienie skryptu na rozmowy mi?dzy frakcjami.
Kiedy jestem na s?u?bie to chat widz? gracze kt?rzy nie s? na s?u?bie.
addCommandHandler("frakcja",function(plr, cmd, ...)
if not getElementData(plr, "player:duty") then return end
local msg = table.concat ( { ... }, " " )
for i,v in pairs(getElementsByType("player")) do
if getElementData(plr, "player:duty")=="SPD" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#0000FF SPD #FF9933"..getPlayerName(plr).."#FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="SES" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#25D6BE SES #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="SATC" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#EBF711 SATC #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="FBSA" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#F71115 FBSA #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
end
end
end)
addCommandHandler("sluzba",function(plr, cmd, ...)
if not getElementData(plr, "player:duty") then return end
local msg = table.concat ( { ... }, " " )
for i,v in pairs(getElementsByType("player")) do
if getElementData(v, "player:duty") then
triggerClientEvent(v,"radio",v)
if getElementData(plr,"player:duty") =="SPD" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#0000FF State Police Department #FF9933"..getPlayerName(plr).." #FFFFFF"..msg.."",plr,255,255,255,true)
elseif getElementData(plr, "player:duty")=="SES" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#25D6BE State Emergency Services #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="SATC" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#EBF711 SATC #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="FBSA" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#F71115 FBSA #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="SBG" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#F71115 SBG #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
end
end
end
end)
addEventHandler("onResourceStart",resourceRoot,function()
for _,plajer in pairs(getElementsByType("player")) do
bindKey(plajer, "y", "down", "chatbox", "frakcja")
bindKey(plajer, "u", "down", "chatbox", "sluzba")
end
end)
addCommandHandler("test",function(plr)
if getElementData(source,"player:duty")==1 then
setElementData(plr, "player:duty","SAMC",false)
if getElementData(source,"player:duty")==0 then
setElementData(plr, "player:duty", "SAPD",true)
end)
addCommandHandler("Kr?tkofal?wka", function(plr, cmd, ...)
if getTeamName(getPlayerTeam(plr)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(plr)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(plr)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(plr)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(plr)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(plr)) == "United State Army" then
local r,g,b = getTeamColor(getPlayerTeam(plr))
local x,y,z = getElementPosition(plr)
local Nick = getPlayerName(plr)
local msg = table.concat(arg, " ")
local team1 = getPlayerTeam(plr)
local frakcja = getTeamName(team1)
for i,v in ipairs(getElementsByType("player")) do
if getTeamName(getPlayerTeam(v)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(v)) == "United State Army" then
playSoundFrontEnd(v, 49)
outputChatBox("#c7c7c7** ((Radio))#c7c7c7 ( " .. frakcja .." ) : #666666**szum** #afafaf"..msg,v,r,g,b,true)
end
end
else
outputChatBox("Nie masz uprawnie?!", plr)
end
end)
addEventHandler("onResourceStart", root, function()
local players=getElementsByType('player')
for _, p in pairs(players) do
bindKey(p, "u", "down", "chatbox", "Kr?tkofal?wka")
end
end)
addEventHandler( "onPlayerSpawn", getRootElement(),
function (_)
bindKey(source, "u", "down", "chatbox", "Kr?tkofal?wka")
end
)
Jak doda? tu sw?j w?asny plik dzwi?kowy zamiast tego o id 49
addCommandHandler("Kr?tkofal?wka", function(plr, cmd, ...)
if getTeamName(getPlayerTeam(plr)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(plr)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(plr)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(plr)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(plr)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(plr)) == "United State Army" then
local r,g,b = getTeamColor(getPlayerTeam(plr))
local x,y,z = getElementPosition(plr)
local Nick = getPlayerName(plr)
local msg = table.concat(arg, " ")
local team1 = getPlayerTeam(plr)
local frakcja = getTeamName(team1)
for i,v in ipairs(getElementsByType("player")) do
if getTeamName(getPlayerTeam(v)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(v)) == "United State Army" then
playSoundFrontEnd(v, 49)
outputChatBox("#c7c7c7** ((Radio))#c7c7c7 ( " .. frakcja .." ) : #666666**szum** #afafaf"..msg,v,r,g,b,true)
end
end
else
outputChatBox("Nie masz uprawnie?!", plr)
end
end)
addEventHandler("onResourceStart", root, function()
local players=getElementsByType('player')
for _, p in pairs(players) do
bindKey(p, "u", "down", "chatbox", "Kr?tkofal?wka")
end
end)
addEventHandler( "onPlayerSpawn", getRootElement(),
function (_)
bindKey(source, "u", "down", "chatbox", "Kr?tkofal?wka")
end
)
Jak doda? tu sw?j w?asny plik dzwi?kowy zamiast tego o id 49
addCommandHandler("Kr?tkofal?wka", function(plr, cmd, ...)
if getTeamName(getPlayerTeam(plr)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(plr)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(plr)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(plr)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(plr)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(plr)) == "United State Army" then
local r,g,b = getTeamColor(getPlayerTeam(plr))
local x,y,z = getElementPosition(plr)
local Nick = getPlayerName(plr)
local msg = table.concat(arg, " ")
local team1 = getPlayerTeam(plr)
local frakcja = getTeamName(team1)
for i,v in ipairs(getElementsByType("player")) do
if getTeamName(getPlayerTeam(v)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(v)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(v)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(v)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(v)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(v)) == "United State Army" then
playSound(v, "radyjo.wav")
outputChatBox("#c7c7c7** ((Radio))#c7c7c7 ( " .. frakcja .." ) : #666666**szum** #afafaf"..msg,v,r,g,b,true)
end
end
else
outputChatBox("Nie masz uprawnie?!", plr)
end
end)
addEventHandler("onResourceStart", root, function()
local players=getElementsByType('player')
for _, p in pairs(players) do
bindKey(p, "u", "down", "chatbox", "Kr?tkofal?wka")
end
end)
addEventHandler( "onPlayerSpawn", getRootElement(),
function (_)
bindKey(source, "u", "down", "chatbox", "Kr?tkofal?wka")
end
)
addCommandHandler("Kr?tkofal?wka", function(plr, cmd, ...)
if getTeamName(getPlayerTeam(plr)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(plr)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(plr)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(plr)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(plr)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(plr)) == "United State Army" then
local r,g,b = getTeamColor(getPlayerTeam(plr))
local x,y,z = getElementPosition(plr)
local Nick = getPlayerName(plr)
local msg = table.concat(arg, " ")
local team1 = getPlayerTeam(plr)
local frakcja = getTeamName(team1)
for i,v in ipairs(getElementsByType("player")) do
if getTeamName(getPlayerTeam(v)) == "Federal Bureau of Investigation" or getTeamName(getPlayerTeam(v)) == "Los Santos Police Department" or getTeamName(getPlayerTeam(v)) == "Los Santos Medical Center" or getTeamName(getPlayerTeam(v)) == "Los Santos Fire Department" or getTeamName(getPlayerTeam(v)) == "Los Angeles Sheriff Dept." or getTeamName(getPlayerTeam(v)) == "United State Army" then
playSound(v, "radyjo.wav")
outputChatBox("#c7c7c7** ((Radio))#c7c7c7 ( " .. frakcja .." ) : #666666**szum** #afafaf"..msg,v,r,g,b,true)
end
end
else
outputChatBox("Nie masz uprawnie?!", plr)
end
end)
addEventHandler("onResourceStart", root, function()
local players=getElementsByType('player')
for _, p in pairs(players) do
bindKey(p, "u", "down", "chatbox", "Kr?tkofal?wka")
end
end)
addEventHandler( "onPlayerSpawn", getRootElement(),
function (_)
bindKey(source, "u", "down", "chatbox", "Kr?tkofal?wka")
end
)
daj nam DB3 to ogarne, plik radyjo.wav musi byc w folderze ze skryptem.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach