• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new vehicles and skins in open.mp – help with DFF/TXD
#1
Content:
Hi, I’m returning to PAWN after a few years and I want to set up a server. I already have an online server account and I need help adding new vehicles and skins.

Questions:

1. Is it possible to add new vehicles (BMW, Audi, Tesla, etc.) that players can automatically download when joining the server?


2. Is it possible to add custom character skins, also with automatic downloading?



I’ve tried various methods from Google and YouTube (DFF/TXD, artwork-index.json), but nothing works.

Ideally, I would like a ready-to-use example: DFF/TXD files, working PAWN gamemode, and proper config.json setup, so everything downloads automatically when a client joins the open.mp server.

I’m using:

open.mp server and client on Windows

Online hosted server

PAWN gamemode


If anyone has a working example or step-by-step tutorial – I’d really appreciate the help.


---
  Reply
#2
Hi there, my response might be late, but I think it's okay.

You can have custom objects and character models (skins) but I'm not sure if you can do the same with cars.
Anyway, to have custom character skins and objects do the following:

In your config.json set artwork to true

Code:
"artwork": {
"cdn": "",
"enable": true,
"models_path": "models",
"port": 7777,
"web_server_bind": ""
},

Place your models inside the models folder.

Configure them using a text file named artconfig.
It should look something like this:

[Image: JjUzpg0.png]

this is how I would implement it :

Code:
CMD:skin(playerid, params[])
{
    CHECK_LOGGED(playerid) // check if the player is logged
    new skinid; // variable to store the skin ID entered by the player.
    if (sscanf(params, "d", skinid)) return SendClientMessage(playerid, 0xFF0000AA, PREFIX_ERROR "Usage: /skin <id>"); // "d" which stands for [b]decimal integer [/b]means we expect a single integer (the skin ID).
    if ((skinid < 0 || skinid > 312) && (skinid < 20001 || skinid > 20022)) return SendClientMessage(playerid, 0xFF0000AA, PREFIX_ERROR "Invalid skin ID.");
    
    // custom skins are between 20001 and 20022 (range is defined by you)

    SetPlayerSkin(playerid, skinid); // apply the skin to the player
    SendClientMessage(playerid, 0xFFFFFFFF, PREFIX "Skin changed!"); // let them know that their skin is changed ;)
    return 1;
}

the player can then use the custom skin by entering the command /skin followed by a specific ID, for example /skin 20001 which will set their player skin to lvpdpc2 (the custom skin we set up in the artconfig.txt)

just a small note: AddCharModel adds character models, use that only for character models.
  Reply
#3
Thanks, I’ve already figured it out. You’re right – vehicles can’t really be replaced, because when the server tries to stream .dff files on join, it throws an error.
  Reply


Forum Jump: