LielXD / CS2-WeaponPaints-Website

Some website i've made for my cs2 server for the plugin cs2-weaponpaints and wanted to share this with the community.
https://cs2.lielxd.com
MIT License
51 stars 15 forks source link

API Retrieve and Seperation Function Request (Data Folder) #59

Open emreires opened 5 months ago

emreires commented 5 months ago

Hi there,

First of all, amazing release!

Can you share the functions to retrieve the data folder as in your structure? As you know, game is updating and new skins, knives are adding into the game. It would be perfect if you can share it. There is an example in the original repo, but yours looks much different.

Thank you!

LielXD commented 5 months ago

Thank you. well to add skins to the website all you need to do is to access the data/*.json whatever json file you want and copy paste one skin and fill with the new skin data. not complicated at all.

emreires commented 5 months ago

I was actually more interested in how you created the files. Knowing that will give me the ability to create different json files in different languages.

LielXD commented 5 months ago

Copy Paste the original website jsons and just add the following:

Default Music kit (music.json):

{
    "id": "0",
    "name": "Default",
    "image": "https://raw.githubusercontent.com/LielXD/CS2-WeaponPaints-Website/main/src/musickits/default.png"
},

Default Agents (agents.json):

{
    "team": 2,
    "image": "https://raw.githubusercontent.com/LielXD/CS2-WeaponPaints-Website/main/src/agents/t_agent_default.png",
    "model": "default",
    "agent_name": "Default Agent | Default"
},
{
    "team": 3,
    "image": "https://raw.githubusercontent.com/LielXD/CS2-WeaponPaints-Website/main/src/agents/ct_agent_default.png",
    "model": "default",
    "agent_name": "Default Agent | Default"
},

Default Gloves (gloves.json):


{
    "weapon_defindex": "gloves_default",
    "paint": "0",
    "image": "https://raw.githubusercontent.com/LielXD/CS2-WeaponPaints-Website/main/src/gloves/default.png",
    "paint_name": "Default Gloves | Default"
},

Default Knife (skins.json):

{
    "weapon_defindex":"none",
    "weapon_name":"weapon_knife_default",
    "paint":"0",
    "image":"https://raw.githubusercontent.com/Nereziel/cs2-WeaponPaints/main/website/img/skins/weapon_knife.png",
    "paint_name":"Default Knife | Default"
}

Thats all needed for my website.

emreires commented 5 months ago

I believe you got me wrong.

So, the main repo used CSGO-API to get all the skins, agents etc. However, the API format is different than the one we're using in the data folder.

There is a structure in the data folder. And the main repo's owner, used a function or whatever to retrieve the data in the format we use.

Anyway, I found a similar request and bumped it: https://github.com/Nereziel/cs2-WeaponPaints/issues/58

Thank you anyway! :)