Wysłany: 2013-04-16, 19:01
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Witam chce zrobi? system bram na xml ale co? nie tworzy bramy b??d jest tu
function bramylista ()
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "bramy" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
local id = xmlNodeGetAttribute ( brama , "id" )
local x = xmlNodeGetAttribute ( brama , "x" )
local y = xmlNodeGetAttribute ( brama , "y" )
local zo = xmlNodeGetAttribute ( brama , "zo" )
local zz = xmlNodeGetAttribute ( brama , "zz" )
local acl = xmlNodeGetAttribute ( brama , "acl" )
end
end
xmlUnloadFile ( xml )
end
function two ()
bramylista ()
st = createObject ( id , x , y , zz , 0 , 0 , 0 )
end
function stO ( thePlayer )
bramylista ()
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( acl )) then
moveObject ( st , 1000 , x , y , zo )
outputChatBox ( "Otwieranie Trwa" , thePlayer , 219 , 78 , 1 , false )
end
end
addCommandHandler ( "open" , stO )
To jest kawa?ek kodu. Problem jest taki ze nie robi bramy
Wysłany: 2013-04-16, 19:07
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Wysłany: 2013-04-16, 19:10
Yakamashi
Skrypter
Wiek: 41 Na forum: 4797 dni Posty: 19
Nick w MP: Yakamashi
Piwa : 18
Kod:
st = createObject ( id, x, y, zz, 0, 0, 0 )
Skrypt ma sam pobierac dane z twojej glowy?
Na samej gorze w pierwszej linijce wstaw funkcje z tworzeniem objectu.
np:
Kod:
test = createObject ( 203, -205, 45, 14, 0, 0, 0 )
Jesli sie myle i cos zle zrozumialem pytanie prosze poprawic.
Jesli udalo sie naprawic licze na
Podpis
[you]
, jestem alkoholikiem, postaw mi prosze zimne piwo.
Wysłany: 2013-04-16, 19:20
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Yakamashi , skrypt pobiera dane z xml.
luki123luki123 , dwie sprawy,
pierwsza, pod funkcj? two musi by? zdarzenie wywo?uj?ce
druga, spr?buj umie?ci? createObject pod tymi zmiennymi xmlNodeGetAttribute
Wysłany: 2013-04-16, 19:34
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2013-04-16, 19:41
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
I fajnie by?oby to zrobi?, przy pomocy return?w. Tu masz zmienn? lokaln? i pewnie Ci t o nie b?dzie dzia?a?.
Wysłany: 2013-04-16, 20:05
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
to tak zrobi?em :
function two ()
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "bramy" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
st = createObject ( xmlNodeGetAttribute ( brama , "id" ), xmlNodeGetAttribute ( brama , "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zz" ), 0 , 0 , 0 )
end
end
end
function stO ( thePlayer )
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "bramy" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( xmlNodeGetAttribute ( brama , "acl" ))) then
moveObject ( st , 1000 , xmlNodeGetAttribute ( brama , "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zo" ) )
outputChatBox ( "Otwieranie Trwa" , thePlayer , 219 , 78 , 1 , false )
end
xmlUnloadFile ( xml )
end
end
end
addCommandHandler ( "open" , stO )
function stC ( thePlayer )
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "bramy" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( xmlNodeGetAttribute ( brama , "acl" ))) then
moveObject ( st , 1000 , xmlNodeGetAttribute ( brama , "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zz" ) )
outputChatBox ( "Otwieranie Trwa" , thePlayer , 219 , 78 , 1 , false )
end
xmlUnloadFile ( xml )
end
end
end
addCommandHandler ( "close" , stC )
Teraz jest b?ad moveObject i dalej nie wida? bram
Wysłany: 2013-04-16, 20:07
vipSEBOvip
A poor begginer
Wiek: 26 Na forum: 5178 dni Posty: 597
Nick w MP: xSebaPL
Piwa : 77
Sprawd? czy wida? pierwsz? bram? z listy. Jak wida?, u?yj tonumber, jak nie wida? to nie wiem
Wysłany: 2013-04-16, 20:08
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Mam pomys? jak by zapisa? zmienn? local st przy pomocy setElementData to czy by si? nie uda?o
[ Dodano : 2013-04-16, 20:12 ]
Nie wida? bram
Wysłany: 2013-04-16, 21:04
Yakamashi
Skrypter
Wiek: 41 Na forum: 4797 dni Posty: 19
Nick w MP: Yakamashi
Piwa : 18
Jakie masz bledy w debugscript?
Podpis
[you]
, jestem alkoholikiem, postaw mi prosze zimne piwo.
Wysłany: 2013-04-17, 07:03
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2013-04-17, 15:38
Yakamashi
Skrypter
Wiek: 41 Na forum: 4797 dni Posty: 19
Nick w MP: Yakamashi
Piwa : 18
Kod:
function two ()
local xml = xmlLoadFile ( "bramki.xml")
if xml then
local file = xmlFindChild (xml,"bramy",0)
for i,brama in ipairs (xmlNodeGetChildren(file)) do
st = createObject ( xmlNodeGetAttribute (brama,"id"), xmlNodeGetAttribute (brama"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zz"), 0, 0, 0 )
end
end
end
function stO ( thePlayer)
local xml = xmlLoadFile ( "bramki.xml")
if xml then
local file = xmlFindChild (xml,"bramy",0)
for i,brama in ipairs (xmlNodeGetChildren(file)) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(xmlNodeGetAttribute (brama,"acl"))) then
moveObject ( st, 1000, xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zo") )
outputChatBox ("Otwieranie Trwa", thePlayer, 219, 78, 1, false )
end
xmlUnloadFile(xml)
end
end
end
addCommandHandler("open", stO )
function stC ( thePlayer)
local xml = xmlLoadFile ( "bramki.xml")
if xml then
local file = xmlFindChild (xml,"bramy",0)
for i,brama in ipairs (xmlNodeGetChildren(file)) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(xmlNodeGetAttribute (brama,"acl"))) then
moveObject ( st, 1000, xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zz") )
outputChatBox ("Otwieranie Trwa", thePlayer, 219, 78, 1, false )
end
xmlUnloadFile(xml)
end
end
end
addCommandHandler("close", stC )
Sprobuj to, jesli skrypt nie odpali przeczytaj debugscript.
Podpis
[you]
, jestem alkoholikiem, postaw mi prosze zimne piwo.
Wysłany: 2013-04-17, 17:46
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Nie wida? bram czat pisz? ?e otwiera brame zamyka
b?edy w debugscript : aclGetGroup , moveObject
[ Dodano : 2013-04-17, 17:54 ]
Ziomek11 , Jak to zrobi?
Wysłany: 2013-04-17, 18:43
Yakamashi
Skrypter
Wiek: 41 Na forum: 4797 dni Posty: 19
Nick w MP: Yakamashi
Piwa : 18
bramy nie ma bo jest blad w funkcji moveObject. Zaraz postaram sie napisac od nowa skrypt i ci go podeslac.
[ Dodano : 2013-04-17, 18:47 ]
Jakbys mogl podeslij mi takze zawartosc xml.
Podpis
[you]
, jestem alkoholikiem, postaw mi prosze zimne piwo.
Wysłany: 2013-04-17, 19:27
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
< root >
< brama >
< brama id = "987" x = "-1533.8" y = "473.62" zo = "6" zz = "8" acl = "Policja" > Policja </ brama >
< brama id = "987" x = "-1540" y = "454.20001" zo = "2" zz = "8" acl = "Policja" > Policja </ brama >
< brama id = "987" x = "-1564.5" y = "483" zo = "2" zz = "8" acl = "Policja" > Policja </ brama >
</ brama >
</ root >
[ Dodano : 2013-04-17, 19:28 ]
function two ()
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "brama" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
st = createObject ( xmlNodeGetAttribute ( brama , "id" ), xmlNodeGetAttribute ( brama "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zz" ), 0 , 0 , 0 )
end
end
end
function stO ( thePlayer , st )
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "brama" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( xmlNodeGetAttribute ( brama , "acl" ))) then
moveObject ( st , 1000 , xmlNodeGetAttribute ( brama , "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zo" ) )
outputChatBox ( "Otwieranie Trwa" , thePlayer , 219 , 78 , 1 , false )
end
xmlUnloadFile ( xml )
end
end
end
addCommandHandler ( "open" , stO )
function stC ( thePlayer , st )
local xml = xmlLoadFile ( "bramki.xml" )
if xml then
local file = xmlFindChild ( xml , "brama" , 0 )
for i , brama in ipairs ( xmlNodeGetChildren ( file )) do
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( xmlNodeGetAttribute ( brama , "acl" ))) then
moveObject ( st , 1000 , xmlNodeGetAttribute ( brama , "x" ) , xmlNodeGetAttribute ( brama , "y" ) , xmlNodeGetAttribute ( brama , "zz" ) )
outputChatBox ( "Otwieranie Trwa" , thePlayer , 219 , 78 , 1 , false )
end
xmlUnloadFile ( xml )
end
end
end
addCommandHandler ( "close" , stC )
Tagi: system :: bram
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: