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

Wysłany: 2014-10-04, 17:53


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

function spawnAut()
local xml = getResourceConfig("auta.xml")
local modelauta = xmlNodeGetAttribute(xml, "model")
local carX = xmlNodeGetAttribute(xml, "posX")
local carY = xmlNodeGetAttribute(xml, "posY")
local carZ = xmlNodeGetAttribute(xml, "posZ")
local carRot = xmlNodeGetAttribute(xml, "rot")
createVehicle(modelauta, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carRot))
end


Po wpisaniu w auta.xml odpowiedniego kodu:
<car model="528" posX="349.80227661133" posY="1358.1834716797" posZ="7.955379486084" rot="90.0" />

Nie spawni si?! Za pomoc :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 18:06


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

Jakie? b??dy w db3?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 18:37


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Same BadArgumenty

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 19:29


KukiX







Wiek: 34
Na forum: 6859 dni
Posty: 567

Piwa: 17560

Respekt: 160
Respekt: 160Respekt: 160

Maximerr, zdefiniowa?e? plik auta.xml w meta.xml?

Podpis
Moje skrypty MTA:
¤PlayDM
¤Mini-Games v0.2
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 20:00


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

tak.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 21:38


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Maximerr, co trzeba zrobi? OPISZ!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 21:43


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Prosz? o pomoc przy tym skrypcie. Same Bad Argumenty wyskakuj?, a skrypt wszystko powinien wczyta? i wczytywa? zapisane auta. Je?li mo?na to prosz? o naprowadzenie mnie, jak zrobi? system aut aby po wpisaniu /zaparkuj si? dodawa? do xml(wychodzi mi to p??/p??) itp..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 23:15


Tostuch







Wiek: 28
Na forum: 5072 dni
Posty: 483
Nick w MP: Tost

Piwa: 137

Respekt: 110
Respekt: 110

local xml = xmlLoadFile("auta.xml")

xmlLoadFile, a nie getResourceConfig :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 23:39


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

P?tli u?yj..

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-04, 23:41


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Shuffle, m?g?by? mi to napisa? w kod? Zawsze mia?em problem z p?tlami..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-05, 08:25


TheTroll

Pan Majster






Wiek: 39
Na forum: 4905 dni
Posty: 219
Nick w MP: TheTroll

Piwa: 1117

Respekt: 120
Respekt: 120

Powinno to wygl?da? mniej wi?cej tak

function spawnAut()
local xml = getResourceConfig("auta.xml")
for i,v in ipairs (xmlNodeGetChildren(xml)) do
local modelauta = xmlNodeGetAttribute(v, "model")
local carX = xmlNodeGetAttribute(v, "posX")
local carY = xmlNodeGetAttribute(v, "posY")
local carZ = xmlNodeGetAttribute(v, "posZ")
local carRot = xmlNodeGetAttribute(v, "rot")
createVehicle(modelauta, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carRot))
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-05, 09:56


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Ma?a poprawa Pana wy?ej :


function spawnAut()
local xml = xmlLoadFile("auta.xml")
for i,v in ipairs (xmlNodeGetChildren(xml)) do
local modelauta = xmlNodeGetAttribute(v, "model")
local carX = xmlNodeGetAttribute(v, "posX")
local carY = xmlNodeGetAttribute(v, "posY")
local carZ = xmlNodeGetAttribute(v, "posZ")
local carRot = xmlNodeGetAttribute(v, "rot")
createVehicle(modelauta, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carRot))
end
end


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-05, 10:59


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

Nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-05, 12:49


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

function spawnAut(player)
local xml = xmlLoadFile ( "auta.xml")
    if xml  then
        local file = xmlFindChild (xml,"root",0)
            for i,lista in ipairs (xmlNodeGetChildren(file)) do
           local modelauta = xmlNodeGetAttribute(lista, "model")
           local carX = xmlNodeGetAttribute(lista, "posX")
           local carY = xmlNodeGetAttribute(lista, "posY")
           local carZ = xmlNodeGetAttribute(lista, "posZ")
           local carRot = xmlNodeGetAttribute(lista, "rot")
           createVehicle(modelauta, tonumber(carX), tonumber(carY), tonumber(carZ), 0.0, 0.0, tonumber(carRot))
        end
    end
xmlUnloadFile(xml)    
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-05, 13:04


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4568 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

luki123luki123, Nie dzia?a ;/

[ Dodano: 2014-10-05, 13:04 ]
Brak db3

Postaw piwo autorowi tego posta
 

 
Tagi: zapis :: aut :: xml
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zapis aut w xml 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