• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding new vehicles and skins in open.mp – help with DFF/TXD
#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


Messages In This Thread
RE: Adding new vehicles and skins in open.mp – help with DFF/TXD - by HELLHOUND - 8 hours ago

Forum Jump: