masgoku Posted March 8, 2015 Share Posted March 8, 2015 I have been working on replacing vehicle models at first I was having a issue where only 4 cars would replace now they won't replace I need help. P.S I recently reinstalled windows. Server.Lua function ReplaceCommand ( ) triggerClientEvent( "replaceVeh", getRootElement(), replaceVeh ) end addCommandHandler( "replace", ReplaceCommand ) Skins(Client).Lua local vehicls = { -- [carID] = "car file name", [557] = "monster3", [411] = "infernus", [415] = "cheetah", [545] = "hustler", [541] = "bullet", } function ReplaceVehicle ( ) for id,name in pairs(vehicls) do txd = engineLoadTXD ( name..".txd" ) engineImportTXD ( txd, id ) dff = engineLoadDFF ( name..".dff", 0 ) engineReplaceModel ( dff, id ) end end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Meta.XML <meta> <info author='masgoku' version='1.0' name='Skins' description='Model Swap' type='script' /> <script src="skins.lua" type="client" /> <script src="server.lua" type="server" /> <file src="vehicles/bullet.dff" /> <file src="vehicles/bullet.txd" /> <file src="vehicles/cheetah.dff" /> <file src="vehicles/cheetah.txd" /> <file src="vehicles/comet.dff" /> <file src="vehicles/comet.txd" /> <file src="vehicles/huntley.dff" /> <file src="vehicles/huntley.txd" /> <file src="vehicles/hustler.dff" /> <file src="vehicles/hustler.txd" /> <file src="vehicles/infernus.dff" /> <file src="vehicles/infernus.txd" /> <file src="vehicles/monster3.dff" /> <file src="vehicles/monster3.txd" /> </meta> Link to comment
Callum Posted March 8, 2015 Share Posted March 8, 2015 You need to prepend "vehicles/" to all of the items in the vehicles table, since the TXD/DFF files are in the 'vehicles' folder. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now