Szerző Téma: Autó model betöltési hiba|Nem tölti be  (Megtekintve 740 alkalommal)

Autó model betöltési hiba|Nem tölti be
« Dátum: 2016. Március 14. - 17:13:53 »
0 Show voters
Üdv. Nos van egy egyszerű kis \"script\" aminek a dolga hogy egy random ID-re betöltse a megadott kocsi-t.
Mivel úgy van hogy a flash-re több féle autót kellene betöltenie (pl a flashra rá állítok egy Hondát és egy ferrárit, a honda 130-as ID é as a ferári a 131-...) ez egy egyedi autórendszerhez kellene.
De nem tölti be a megadott flash modelleket.
A leírása alapján  (ezt neten találtam) minden jólvan megadva.
A script
 
function onResourceStart()
local node = xmlLoadFile ( \"mods.xml\" )
if (node) then
local children = xmlNodeGetChildren ( node )
for k,v in ipairs(children) do
   local DFF = xmlNodeGetAttribute(v, \"DFF\")
   local TXD = xmlNodeGetAttribute(v, \"TXD\")
   local Model = tonumber(xmlNodeGetAttribute(v, \"model\"))
   if (DFF and TXD and Model) then
      engineImportTXD ( engineLoadTXD ( TXD ), Model )
      engineReplaceModel ( engineLoadDFF ( DFF,  Model ), Model )
   end
end
else
local root = xmlCreateFile ( \"mods.xml\", \"mods\" )
local root = xmlCreateChild ( root, \"mod\" )
xmlSaveFile ( root )
end
end
addEventHandler(\"onClientResourceStart\", getResourceRootElement(getThisResource()), onResourceStart)

 
A gond már ott adodik hiába benne van, nem hozza létre a se a mod mappát, se az XML-t.
A leírás amit egy fórumon találtam:



This system is for loading vehicle mods without having to modify san andreas files, it does this by using MTA\'s loading functions instead.
De ezt én létre hoztam.Bele raktam a módot.
Bele írtam az mods.xml-be:
To add a vehicle to be replaced edit mods.txt
which should look something like this
<mods>
    <mod />
</mods>
Adding a mod will be pretty simple here, just change it to this
<mods>
    <mod DFF=\"changeme.dff\" TXD=\"changeme.txd\" model=\"changeme\" />
</mods>
where
DFF is the full path to the DFF file
TXD is the full path to the TXD file
model is the model id this is replacing
or your file may look like this
<mods>
    <mod TXD=\"TXD.TXD\" DFF=\"DFF.DFF\" model=\"model\" />
</mods>
in which case add a line
like forth
<mods>
    <mod TXD=\"TXD.TXD\" DFF=\"DFF.DFF\" model=\"model\" />
    <mod TXD=\"changeme.txd\" DFF=\"changeme.dff\" model=\"changeme\" />
</mods>
where
DFF is the full path to the DFF file
TXD is the full path to the TXD file
model is the model id this is replacing
Note everything is case sensative
so
<mod txd=\"changeme.txd\" dff=\"changeme.dff\" MODEL=\"changeme\" />
will not work
Quick example
To replace the enforcer use this line
<mod txd=\"flash.txd\" dff=\"flash.dff\" MODEL=\"124\" />
assuming the enforcer.txd isn\'t in a folder inside vehicle-mods-system if it is read below.
Folders:
if you wish to use folders (its advised) then when editing the txd and dff part of the line from changeme you will need to specify the directory like so
Say you have enforcer.txd and enforcer.dff in a folder mods
<mod TXD=\"mods/enforcer.txd\" DFF=\"mods/enforcer.dff\" model=\"427\" />
is the line you would use
 
De én már bele írtam ,létre hoztam ezt.:
<mods>
    <mod txd=\"flash.txd\" dff=\"flash.dff\" MODEL=\"124\" />
</mods>
és a Debugscript hibát jelez rá.



[2016-03-14 16:53:10] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:10: Error loading TXD @ \'engineLoadTXD\' [flash.txd]
[2016-03-14 16:53:10] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:10: Bad argument @ \'engineImportTXD\' [Expected txd at argument 1, got boolean]
[2016-03-14 16:53:10] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:11: Error loading DFF @ \'engineLoadDFF\' [flash.dff]
[2016-03-14 16:53:10] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:11: Bad argument @ \'engineReplaceModel\' [Expected dff at argument 1, got boolean]
[2016-03-14 16:54:21] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:10: Error loading TXD @ \'engineLoadTXD\' [flash.txd]
[2016-03-14 16:54:21] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:10: Bad argument @ \'engineImportTXD\' [Expected txd at argument 1, got boolean]
[2016-03-14 16:54:21] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:11: Error loading DFF @ \'engineLoadDFF\' [flash.dff]
[2016-03-14 16:54:21] WARNING: vehicle-mods-system\\c_vehicle_mods.lua:11: Bad argument @ \'engineReplaceModel\' [Expected dff at argument 1, got boolean]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal