vanishSHC Posted December 24, 2010 Share Posted December 24, 2010 Hello again. I'm having an issue trying to import a txd/dff over the brassknuckles model into my server. Instead of having brassknuckles I want to replace it with a cigar. Here is the code. Meta: <meta> <info author="n0ps" version="1.1" name="textures" type="misc" /> <script src="skins.lua" type="client" /> <file src="models/brassknuckles.txd"/> <file src="models/brassknuckles.dff"/> </meta> skin.lua: function onResourceStart() blunt = engineLoadTXD ( "models/brassknuckles.txd" ) engineImportTXD ( blunt, 331 ) dff = engineLoadDFF ( "models/brassknuckles.dff", 0 ) engineReplaceModel ( dff, 331 ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) When I load it, I have no model at all for the brass knuckles. No console errors. I Believe its something to do with the engineLoadDFF line. However the wiki tells me I shouldnt use a number if im not replacing a vehicle texture. Any ideas? Link to comment
12p Posted December 24, 2010 Share Posted December 24, 2010 Weapons and peds can't be replaced yet, only TXD. I suggest you to create a TXD for the brassnuckles, but you won't be able to replace it for a cigar or any DFF yet. Link to comment
vanishSHC Posted December 24, 2010 Author Share Posted December 24, 2010 Ah, that saddens me. Oh well. I suppose I'll find an alternative thing to do with it til' weapons/peds are supported. Any idea when that will be released? Link to comment
Oz. Posted December 24, 2010 Share Posted December 24, 2010 (edited) You could always attach another object to the hand bone of the ped, and replace that object with your cigar. Although, we had mixed results when testing that technique on the DKR Server for universal Santa hats attached to ped head bone - sync was ok but ped rotation (eg going down a slope) failed. It might be even worse for a ped's hand, not sure. You could always give it a go, or just wait until a later version of MTA and do it the way you suggested originally. Edited December 25, 2010 by Guest Link to comment
vanishSHC Posted December 24, 2010 Author Share Posted December 24, 2010 Ah well that sounds like it'll work. The goal is to just make a stationary smoking script but anyway.Im having an issue so far local xl,yl,zl = getPedBonePosition (ped, 25) function bluntequip () local blunt = createObject (1485, 0,0,0) attachElements ( blunt, getLocalPlayer(), xl, yl, zl + 1 ) end -- attach it to an event addCommandHandler ( "smokeblunt" , bluntequip ) I am perplexed as I vaguely know what I am doing at this point lol Obviously this code doesnt work, neither did my last attempt. I know im using the right parameters perhaps missing a couple things Link to comment
Castillo Posted December 25, 2010 Share Posted December 25, 2010 function bluntequip () local xl,yl,zl = getPedBonePosition (getLocalPlayer(), 25) local blunt = createObject (1485, 0,0,0) attachElements ( blunt, getLocalPlayer(), xl, yl, zl + 1 ) end addCommandHandler ( "smokeblunt" , bluntequip ) maybe that? i didn't know why you put out of the function the getPedBonePosition and as argument you put "ped" Link to comment
Maccer. Posted December 25, 2010 Share Posted December 25, 2010 attachElements ( blunt, getLocalPlayer(), xl, yl, zl + 1 ) Incorrect usage of parameters 3, 4, and 5. These are offsets of position in distance. If you want to make a blunt-smoking resource, check out the included briefcase resource for the MTA server. It basically attaches a briefcase to the player's left or right hand. Link to comment
vanishSHC Posted December 25, 2010 Author Share Posted December 25, 2010 Ah thanks guys, got it workin now 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