Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-06-20, 20:19


amited







Wiek: 26
Na forum: 3715 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

KilusTv,

local gate createObject 3089, -6720.42,-1473.60,97.410090 ) 
function open() 
moveObject (gate1000, -6720.42,-1474.60,97.41 local query = ("SELECT * FROM tabela WHERE id=? AND frakcja=?",idGraczaWBazie,"KGPLV")
local result = -- tutaj funkcjpobierasz info z bazy
if #result>0 then-- ma dost?p
moveObject brama12000, -2563.7,617.09998,15.4) 
else return end 
end 


Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-06-20, 21:49


KilusTv







Wiek: 28
Na forum: 3999 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

"amited" napisał/a:

KilusTv,

local gate createObject 3089, -6720.42,-1473.60,97.410090 ) 
function open() 
moveObject (gate1000, -6720.42,-1474.60,97.41 local query = ("SELECT * FROM tabela WHERE id=? AND frakcja=?",idGraczaWBazie,"KGPLV")
local result = -- tutaj funkcjpobierasz info z bazy
if #result>0 then-- ma dost?p
moveObject brama12000, -2563.7,617.09998,15.4) 
else return end 
end 


Zrobi?em to i dalej nie dzia?a ;-; (oczywiscie kordy pozmienia?em)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-20, 22:30


amited







Wiek: 26
Na forum: 3715 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

KilusTv, No ale wiesz ?e musisz sobie z bazy pobra? info? Ja tam ci tylko zapytanie da?em.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-21, 10:45


KilusTv







Wiek: 28
Na forum: 3999 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

local gate createObject 30891089.09997558592374.899902343811.1000003814700270 ) 
function open() 
moveObject (gate10001089.09997558592376.399902343811.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 gate20001089.09997558592374.899902343811.10000038147) 
else return end 
end 


Zrobilem tak no i nie dziala.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-21, 11:32


neku^







Wiek: 24
Na forum: 3522 dni
Posty: 461
Nick w MP: neku^

Piwa: 1186

Respekt: 320,5
Respekt: 320,5Respekt: 320,5Respekt: 320,5


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

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-06-21, 12:38


amited







Wiek: 26
Na forum: 3715 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


local gate createObject 30891089.09997558592374.899902343811.1000003814700270 ) 
function open() 
moveObject (gate10001089.09997558592376.399902343811.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 gate20001089.09997558592374.899902343811.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

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-06-21, 13:29


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4557 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5


local gate createObject 30891089.09997558592374.899902343811.1000003814700270 ) 
function open() 
moveObject (gate10001089.09997558592376.399902343811.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 gate20001089.09997558592374.899902343811.10000038147) 
else return end 
end 


Je?li to ogrpg to powinno dzia?a?

[ Dodano: 2017-06-21, 13:45 ]
"JoKeR7026" napisał/a:

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.
Kod:


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)

addEventHandler("onPlayerSpawn",getRootElement(),
function(_)
bindKey(source, "y", "down", "chatbox", "frakcja")
bindKey(source, "u", "down", "chatbox", "sluzba")
end)
--[[
addCommandHandler("test",function(plr)
setElementData(plr, "player:duty","SAMC",false)
setElementData(plr, "player:duty", "SAPD",true)
end)

addCommandHandler("test2",function(plr)
setElementData(plr, "player:duty", "SAPD", false)
setElementData(plr, "player:duty", "SAMC",true)
end)
--]]

wszedzie masz elseif zamiast else if i nie wiem czy to nie przez to ;d
Ogolnie ten kod jest bardzo kijowo napisany i s?abo czytalny, za duzy ba?agan


addCommandHandler("test",function(plr)
setElementData(plr"player:duty","SAMC",false)
setElementData(plr"player:duty""SAPD",true)
end)

lepiej b?dzie

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)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
KilusTv
Wysłany: 2017-06-21, 15:59


KilusTv







Wiek: 28
Na forum: 3999 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

Dziekuje wam wszystkim. Leci zimny browarek. Jeszcze jedna sprawa bo te bramy nie chca si? respic. Z czym jest to zwi?zane?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-23, 19:31


DxPelikan5







Wiek: 27
Na forum: 3323 dni
Posty: 9



Respekt: 50

Kod:

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-23, 19:47


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4557 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"DxPelikan5" napisał/a:

Kod:

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

Zamiast

Więcej informacji znajdziesz w Wikipedii MTA:

playSoundFrontEnd

uzyj

Więcej informacji znajdziesz w Wikipedii MTA:

playSound

pamietaj o

Więcej informacji znajdziesz w Wikipedii MTA:

stopSound


[ Dodano: 2017-06-23, 19:58 ]
"KilusTv" napisał/a:

Dziekuje wam wszystkim. Leci zimny browarek. Jeszcze jedna sprawa bo te bramy nie chca si? respic. Z czym jest to zwi?zane?

zaloguj si? do ACL jako admin i potem wpisz w konsole debugscript 3, zrestartuj skrypt i daj nam SS :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 14:32


DxPelikan5







Wiek: 27
Na forum: 3323 dni
Posty: 9



Respekt: 50

Zamieni?em playSoundFrontEnd na playSound i nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 16:37


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4557 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"DxPelikan5" napisał/a:

Zamieni?em playSoundFrontEnd na playSound i nie dzia?a.

mhm a poda?e? w odpowiedni spos?b ?cie?ke do pliku d?wi?kowego? podaj kod kt?ry teraz masz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 21:05


DxPelikan5







Wiek: 27
Na forum: 3323 dni
Posty: 9



Respekt: 50

Kod:

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
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 22:51


koxpl2x22

MAPPER-ALLEREK






Wiek: 23
Na forum: 4557 dni
Posty: 375
Nick w MP: ALLEREK

Piwa: 1726

Respekt: 142,5
Respekt: 142,5

"DxPelikan5" napisał/a:

Kod:

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.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-26, 14:50


DxPelikan5







Wiek: 27
Na forum: 3323 dni
Posty: 9



Respekt: 50

Plik znajduje si? w folderze z skryptem i jest wpisany w mete, w DB 3 wyskakuje to: attempt to call global 'playSound' (a nil value)

Postaw piwo autorowi tego posta
 

 
Tagi: prośby :: przerobienie :: skryptu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zasoby do MTA » PROŚBY O PRZEROBIENIE SKRYPTU Odpowiedz do tematu

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
Dodaj temat do Ulubionych
Wersja do druku