raikjars Posted September 23, 2011 Share Posted September 23, 2011 hi .. I have no doubt with the mta 1.1 (the new vercion) I've seen on this page: https://wiki.multitheftauto.com/wiki/EngineReplaceModel this script is used to replace models (DFF) of cars and objects, but I think it SAYS FROM THE vercion 1.1 Please PEDS AND WEAPONS FOR ... COULD BE TRUE?? because I've been testing with this script but I can not make it go for weapons and peds. there will be some modification to make it work?? as I do to replace the weapons? and peds? the examples given here the page: Example 1: Client Client-Side example for replacing vehicle model and texture with custom ones. function ReplaceVehicle ( ) outputChatBox ( "> replacing the euros vehicle" ) txd = engineLoadTXD ( "data/euros.txd" ) engineImportTXD ( txd, 587 ) dff = engineLoadDFF ( "data/euros.dff", 587 ) engineReplaceModel ( dff, 587 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Server Server-side example function for triggering the replace. function ReplaceCommand ( ) triggerClientEvent( "replaceVeh", getRootElement(), replaceVeh ) end addCommandHandler( "replace", ReplaceCommand ) Example 2: Client Client-Side example for replacing object model, collision and texture with custom ones. function ReplaceObject ( ) txd = engineLoadTXD( "MyModel.txd" ) col = engineLoadCOL( "MyModel.col" ) dff = engineLoadDFF( "MyModel.dff", 0 ) --modelid is everytime 0, when you replace no vehicle engineImportTXD( txd, 1234 ) engineReplaceCOL( col, 1234 ) engineReplaceModel( dff, 1234 )-- replace the model at least end addEvent ( "replaceObj", true ) addEventHandler ( "replaceObj", getRootElement(), ReplaceObject ) Server Server-side example function for triggering the replace. function ReplaceCommand ( ) triggerClientEvent( "replaceObj", getRootElement(), replaceObj ) end addCommandHandler( "replace", ReplaceCommand ) PLEASE HELP ME Link to comment
raikjars Posted September 23, 2011 Author Share Posted September 23, 2011 hi .. I have no doubt with the mta 1.1 (the new vercion) I've seen on this page: https://wiki.multitheftauto.com/wiki/EngineReplaceModel this script is used to replace models (DFF) of cars and objects, but I think it SAYS FROM THE vercion 1.1 Please PEDS AND WEAPONS FOR ... COULD BE TRUE?? because I've been testing with this script but I can not make it go for weapons and peds. there will be some modification to make it work?? as I do to replace the weapons? and peds? the examples given here the page: Example 1: Client Client-Side example for replacing vehicle model and texture with custom ones. function ReplaceVehicle ( ) outputChatBox ( "> replacing the euros vehicle" ) txd = engineLoadTXD ( "data/euros.txd" ) engineImportTXD ( txd, 587 ) dff = engineLoadDFF ( "data/euros.dff", 587 ) engineReplaceModel ( dff, 587 ) end addEvent ( "replaceVeh", true ) addEventHandler ( "replaceVeh", getRootElement(), ReplaceVehicle ) Server Server-side example function for triggering the replace. function ReplaceCommand ( ) triggerClientEvent( "replaceVeh", getRootElement(), replaceVeh ) end addCommandHandler( "replace", ReplaceCommand ) Example 2: Client Client-Side example for replacing object model, collision and texture with custom ones. function ReplaceObject ( ) txd = engineLoadTXD( "MyModel.txd" ) col = engineLoadCOL( "MyModel.col" ) dff = engineLoadDFF( "MyModel.dff", 0 ) --modelid is everytime 0, when you replace no vehicle engineImportTXD( txd, 1234 ) engineReplaceCOL( col, 1234 ) engineReplaceModel( dff, 1234 )-- replace the model at least end addEvent ( "replaceObj", true ) addEventHandler ( "replaceObj", getRootElement(), ReplaceObject ) Server Server-side example function for triggering the replace. function ReplaceCommand ( ) triggerClientEvent( "replaceObj", getRootElement(), replaceObj ) end addCommandHandler( "replace", ReplaceCommand ) PLEASE HELP ME Link to comment
Castillo Posted September 23, 2011 Share Posted September 23, 2011 Yes, it's true, in MTA 1.1.1 (not 1.1) you can replace Weapons and Skin models. An example: local skins = {{"homero", 46}, {"pikachu", 53}} function load() for index, skin in pairs(skins) do txd = engineLoadTXD ( skin[1].. ".txd" ) engineImportTXD ( txd, skin[2] ) dff = engineLoadDFF ( skin[1].. ".dff", 0 ) engineReplaceModel ( dff, skin[2] ) end end addEventHandler("onClientResourceStart",resourceRoot, function () local version = getVersion() if version.mta == "1.1.1" then setTimer ( load, 1000, 1) end end) And the meta.xml should look this: <file src="homero.txd" type="client" /> <file src="homero.dff" type="client" /> <file src="pikachu.txd" type="client" /> <file src="pikachu.dff" type="client" /> Link to comment
Castillo Posted September 23, 2011 Share Posted September 23, 2011 Would you stop creating topics in every section? I've answered your question in your other topic(s). Link to comment
Aibo Posted September 23, 2011 Share Posted September 23, 2011 merged your topics. please do not double-post. 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