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

Wysłany: 2013-04-16, 19:01


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

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 idxyzz00)
end

function stO thePlayer)
bramylista()
if isObjectInACLGroup "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup(acl)) then
moveObject st1000zo )
outputChatBox ("Otwieranie Trwa"thePlayer219781false )
end
end
addCommandHandler("open"stO )

To jest kawa?ek kodu. Problem jest taki ze nie robi bramy

Postaw piwo autorowi tego posta
 

 
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

Respekt: 140
Respekt: 140

Jakie? b??dy ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 19:10


Yakamashi

Skrypter






Wiek: 41
Na forum: 4797 dni
Posty: 19
Nick w MP: Yakamashi

Piwa: 18

Respekt: 60

Ostrzeżeń: 100%
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 :piwo: :D

Podpis
, jestem alkoholikiem, postaw mi prosze zimne piwo.

Postaw piwo autorowi tego posta
 

 
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

Respekt: 140
Respekt: 140

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 19:34


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

ok thx

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 19:41


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

I fajnie by?oby to zrobi?, przy pomocy return?w. Tu masz zmienn? lokaln? i pewnie Ci t o nie b?dzie dzia?a?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 20:05


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

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"), 00)
            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 st1000xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zo") )
                outputChatBox ("Otwieranie Trwa"thePlayer219781false )
                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 st1000xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zz") )
                outputChatBox ("Otwieranie Trwa"thePlayer219781false )
                end    
            xmlUnloadFile(xml)
        end
    end
end
addCommandHandler("close"stC 

Teraz jest b?ad moveObject i dalej nie wida? bram ??

Postaw piwo autorowi tego posta
 

 
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

Respekt: 140
Respekt: 140

Sprawd? czy wida? pierwsz? bram? z listy. Jak wida?, u?yj tonumber, jak nie wida? to nie wiem :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 20:08


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-16, 21:04


Yakamashi

Skrypter






Wiek: 41
Na forum: 4797 dni
Posty: 19
Nick w MP: Yakamashi

Piwa: 18

Respekt: 60

Ostrzeżeń: 100%
Jakie masz bledy w debugscript?

Podpis
, jestem alkoholikiem, postaw mi prosze zimne piwo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-17, 07:03


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

brak b??d?w

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-17, 15:38


Yakamashi

Skrypter






Wiek: 41
Na forum: 4797 dni
Posty: 19
Nick w MP: Yakamashi

Piwa: 18

Respekt: 60

Ostrzeżeń: 100%
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
, jestem alkoholikiem, postaw mi prosze zimne piwo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-17, 17:46


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

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? ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-17, 18:43


Yakamashi

Skrypter






Wiek: 41
Na forum: 4797 dni
Posty: 19
Nick w MP: Yakamashi

Piwa: 18

Respekt: 60

Ostrzeżeń: 100%
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
, jestem alkoholikiem, postaw mi prosze zimne piwo.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-17, 19:27


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

<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"), 00)
end
end
end


function stO (thePlayerst)
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 st1000xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zo") )
outputChatBox ("Otwieranie Trwa"thePlayer219781false )
end
xmlUnloadFile(xml)
end
end
end
addCommandHandler("open"stO )


function stC (thePlayerst)
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 st1000xmlNodeGetAttribute (brama,"x") , xmlNodeGetAttribute (brama,"y") , xmlNodeGetAttribute (brama,"zz") )
outputChatBox ("Otwieranie Trwa"thePlayer219781false )
end
xmlUnloadFile(xml)
end
end
end
addCommandHandler("close"stC 


Postaw piwo autorowi tego posta
 

 
Tagi: system :: bram
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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