Skip to content

Commit

Permalink
feat: clothing dlc, and clothing helpers (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk authored Jun 20, 2024
1 parent 61cd729 commit 38a49e6
Show file tree
Hide file tree
Showing 7 changed files with 1,477 additions and 2,788 deletions.
32 changes: 32 additions & 0 deletions docs/api/server/utility/clothes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Clothing

When you have `dlc` clothing or just need to use clothing in general.

This utility provides a lot of useful information for available clothing maximum values.

!!!
You should 100% use an rpc on server-side to get categories and keep it simple for your userbase.
!!!

```ts
import * as alt from 'alt-server';
import { useRebar } from '@Server/index.js';

const Rebar = useRebar();

// Get all dlc names / categories for male and female
const maleCategories = Rebar.utility.clothing.getCategories('male');
const femaleCategories = Rebar.utility.clothing.getCategories('female');

// Get maximums for a given category
const maximums = Rebar.utility.clothing.getCategory('mp_m_valentines_02');
console.log(maximums.clothes);
console.log(maximums.props);

// Add a custom DLC, will be gettable via categories
// If you set this on server-side, it's only available server-side
// If you set this on client-side, it's only available client-side
// If you set this in webview, it's only available in webview
// What you should do is set it server-side, and use an RPC to get all category data :)
Rebar.utility.clothing.addCategory('my_custom_dlc', { clothes: { 0: 5, 6: 5 }, props: {} });
```
15 changes: 15 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## Version 33

### Code Changes

- Fixes issue where pickup sometimes doesn't spawn the object
- Added all clothing dlc info, and maximums to a shared data structure
- Added clothing data getters to `Rebar.utility.clothing`
- Added addCategory section to add custom DLC data during runtime

### Docs Changes

- Added utility clothes section to server API

---

## Version 32

### Code Changes
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@altv/types-shared": "^16.2.1",
"@altv/types-webview": "^16.2.1",
"@altv/types-worker": "^16.2.0",
"@types/node": "^20.14.2",
"@types/node": "^20.14.6",
"altv-pkg": "^2.7.5",
"autoprefixer": "^10.4.19",
"fast-glob": "^3.3.2",
Expand All @@ -40,8 +40,8 @@
"mongodb": "^6.7.0",
"sjcl": "^1.0.8",
"typescript": "^5.4.5",
"vite": "^5.3.0",
"vue": "^3.4.27",
"vite": "^5.3.1",
"vue": "^3.4.29",
"vue-tsc": "^2.0.21"
},
"prettier": {
Expand Down
Loading

0 comments on commit 38a49e6

Please sign in to comment.