anybox Posted July 24, 2013 Share Posted July 24, 2013 (edited) Hi, i have a problem with skin replacement. I have two folders. First containing 4 files: client.lua, meta.xml, model.dff, model.txd. client.lua function skins() local modelId = 12 local txd = engineLoadTxd("model.txd") engineImportTXD(txd, modelId) local dff = engineLoadDFF("model.dff", modelId) engineReplaceModel(dff, modelId) end addEventHandler("onClientResourceStart", resourceRoot, skins) meta.xml <meta> <script src='client.lua' type='client' /> <file src='model.txd'/> <file src='model.dff'/> </meta> And the second folder consists of two files: server.lua and meta.xml server.lua local spawnX, spawnY, spawnZ = 1959.55, -1714.46, 10 function spawnOnJoin() fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Welcome to boxya shit server", source) spawnPlayer(source, spawnX, spawnY, spawnZ) end addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) function setPlayerOnSpawn() setElementModel(source, 12) end addEventHandler("onPlayerSpawn", getRootElement(), setPlayerOnSpawn) meta.xml <meta> <info author="test" type="gamemode" name="Team Server" description="My first mta server"/> <script src="server.lua"/> </meta> I run the server and type two commands: start myserver start loadmodels These resources succesfully loaded. I join the server and see no changes. The model is still current. So i don't know what is the problem. Help me to find solution. Thanks Edited July 24, 2013 by Guest Link to comment
Castillo Posted July 24, 2013 Share Posted July 24, 2013 Any error(s) on debugscript? Link to comment
anybox Posted July 24, 2013 Author Share Posted July 24, 2013 (edited) No errors, no messages. debugscript is set to level 3. I suspect that onClientResourceStart doesn't work at all. I put outputConsole and outputChatBox commands to the start of my skins() function and saw no messages in the chat or console. Maybe something wrong with client.lua loading... Edited July 24, 2013 by Guest Link to comment
Castillo Posted July 24, 2013 Share Posted July 24, 2013 function skins ( ) outputChatBox ( "SKIN REPLACEMENT LOADED" ) local modelId = 12 local txd = engineLoadTXD ( "model.txd" ) engineImportTXD ( txd, modelId ) local dff = engineLoadDFF ( "model.dff", modelId ) engineReplaceModel ( dff, modelId ) end addEventHandler ( "onClientResourceStart", resourceRoot, skins ) See what it outputs to chatbox. Link to comment
anybox Posted July 24, 2013 Author Share Posted July 24, 2013 Hm. Now it posted the message "SKIN REPLACEMENT LOADED" into the chatbox. Link to comment
Castillo Posted July 24, 2013 Share Posted July 24, 2013 Ah, I found the issue, you made a typo when writing "engineLoadTXD", you put "engineLoadTxd", copy my code and it should work. Link to comment
anybox Posted July 24, 2013 Author Share Posted July 24, 2013 Solidsnake14, thanks. Now it works. But it's strange that console doesn't print anything about this. debugscript is equal to 3 and nothing reminds me about the problem line. Thank you Link to comment
Castillo Posted July 24, 2013 Share Posted July 24, 2013 The server console won't print it. And the debugscript ( ingame ) did output the error. 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