[TUTORIAL] How to add a skin/object
#1

AddCharModel

How to add a skin :
1. Get a .dff file and a .txd file
2. Place the files in the models folder (If you do not have one, create one)
3. Inside of models/artconfig.txt add a new line with the following parameters

Код:
AddCharModel(305, 25002, "andre.dff", "andre.txd");
Parameters :
1 . Any existing skin, it will inherit it's features. Such as walking speed, walking style etc.
2. The ID of the skin, which you can use in SetPlayerSkin (IMPORTANT : ranges from 20000 to 30000)
3. The DFF file (From models folder)
4. The TXD file (From models folder)

Notes :
You can find a lot of skins on http://www.gamemodding.net/

--------------------------------------------------------

AddSimpleModel

How to add custom objects :
1. Get a .dff file and a .txd file
2. Place the files in the models folder
3. Inside of models/artconfig.txt add a new line with the following parameters

Код:
AddSimpleModel(-1,19379, -2000, "wallzzz.dff", "wallzzz.txd");
Parameters :
1. Virtual world
2. Any existing object, it will inherit it's features.
3. The ID of the object, which you can use in CreateObject (IMPORTANT : from -1000 to -30000)
4. The DFF file (From models folder)
5. The TXD file (From models folder)

Notes :
I have attached a zip file containing a DFF and TXD file for a simple crate that I modeled in Blender, feel free to use it!

Reply
#2

You could make it before me even though I almost finished it

OT; Good job.
Reply
#3

Nice!
Reply
#4



It won't show object created, any idea why?
Reply
#5

Quote:
Originally Posted by Saddin
Посмотреть сообщение


It won't show object created, any idea why?
Show me the line that you added in artconfig.txt
Reply
#6

Quote:
Originally Posted by Codeah
Show me the line that you added in artconfig.txt
PHP код:
AddSimpleModel(-119379, -2001"ferrari.dff""ferrari.txd"); 
Reply
#7

Quote:
Originally Posted by Saddin
Посмотреть сообщение
PHP код:
AddSimpleModel(-119379, -2001"ferrari.dff""ferrari.txd"); 
What kind of object are you trying to add? You can't add vehicle models.

If its a regular object make sure your client actually downloaded it.
Reply
#8

Quote:
Originally Posted by dugi
Посмотреть сообщение
What kind of object are you trying to add? You can't add vehicle models.

If its a regular object make sure your client actually downloaded it.
Its vehicle model so nevermind, sorry
Reply
#9

Quote:
Originally Posted by Codeah
Посмотреть сообщение
2. The ID of the skin, which you can use in SetPlayerSkin (IMPORTANT : from 20000 to 30000)
It's wrong, it's starting from 25000
Reply
#10

Quote:
Originally Posted by Sasino97
Посмотреть сообщение
It's wrong, it's starting from 25000

Player skins use ranges: 20000 to 30000 (10000 slots)
Objects use negative IDs: -1000 to -30000 (29000 slots)

No it isn't. It is literally on the 3.8 thread.
Reply
#11

How to know the Base ID from a model? or I only need to put someone to "Replace" and take a valid id?

AddSimpleModel(virtualworld, baseid, newid, dffname[], txdname[]);
Reply
#12

Theoretically, you can take any model id as base id (from the existing ones). The object you're going to add will inherit the properties of the base model. So for example if you add a cube without a collision to your server, and you use an object with collision as base id, it will inherit the collision information from that object. It also inherits a little bit more but I cannot say what exactly.

I recently had an issue with a table, that I extracted from the game and attached a collision to it (so that people can no longer run through that table). I didn't modify the model itself so I was wondering why the glass was no longer being displayed. It was solved by using the base id of the original table so that it inherits the information which was required for displaying the glass: https://sampforum.blast.hk/showthread.php?tid=646642
Reply
#13

I tried to add a weapon as object but In Game i just see an interrogation point, do you know why?
Reply
#14

Where's the models folder?
Reply
#15

In the root directory of your server. If it isn't available (that's the case for linux), create it.
Reply
#16

Quote:
Originally Posted by Joshhh
Посмотреть сообщение
Where's the models folder?
if it's not present in your server folder, just create one in the root directory
Reply
#17

Great tutorial, +rep.
Reply
#18

Record Video please , im from Vietnam don't know English xD...
Reply
#19

So... No need adding colision files?
Reply
#20

Quote:
Originally Posted by Victor012
Посмотреть сообщение
So... No need adding colision files?
Nope
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)