Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ If you've downloaded the previous version, I've included descriptions / tags abo

# Personal Information Snippet

-- Client-Side LUA --

## Client-Side LUA
```lua
QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(data)
inventory = data.inventory
other = data.other
Expand Down Expand Up @@ -56,9 +56,10 @@ QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(dat
pCID = PlayerData.citizenid,
pID = GetPlayerServerId(PlayerId()),
})
```

-- HTML --

## HTML
```html
<div class="player-name-title"> <span class="name-info-title">Name : </span></div>
<div class="player-name"> <span class="name-info">Player-Name</span></div>
<div class="phone-number-title"> <span class="phone-number-info">Phone Number : </span></div>
Expand All @@ -71,9 +72,10 @@ QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(dat
<div class="phone-number-line"></div>
<div class="player-id-line"></div>
<div class="citizen-id-line"></div>
```

-- JS --

## JS
```js
$(".player-name-title").html('Name');
$(".player-name").html(data.pName);
$(".phone-number-title").html('Phone Number');
Expand All @@ -82,9 +84,10 @@ $(".player-id-title").html('State ID');
$(".player-id").html(data.pID);
$(".citizen-id-title").html('Citizen ID');
$(".citizen-id").html(data.pCID);
```

-- CSS --

## CSS
```css
.ply-number-line {
overflow: hidden;
position: absolute;
Expand Down Expand Up @@ -232,11 +235,12 @@ $(".citizen-id").html(data.pCID);
margin-left: 17.5%;
font-weight: 300;
}
```

# Basic Damage / Health Snippet

-- Client-Side LUA --

## Client-Side LUA
```lua
local stress = 0

RegisterNetEvent('hud:client:UpdateStress', function(newStress) -- Add this event with adding stress elsewhere
Expand Down Expand Up @@ -282,16 +286,19 @@ QBCore.Functions.TriggerCallback('inventory:server:ConvertQuality', function(dat
pStress = stress,
pHealth = 200 - GetEntityHealth(PlayerPedId()),
})
```

-- JS --
## JS
```js
$(".skull-damage").html('Stress : ');
$(".skull-damage-title").html(data.pStress);

$(".body-damage").html('Damage : ');
$(".body-damage-title").html(data.pDamage + "%");
```

-- HTML --

## HTML
```html
<!-- Player Body Image -->
<div class="player-body-container">
<div class="player-body">
Expand All @@ -311,9 +318,10 @@ $(".body-damage-title").html(data.pDamage + "%");
<div class="body-damage-title"></div>
<div class="body-damage-line"></div>
</div>
```

-- CSS --

## CSS
```css
/* Player Body */
.player-body-container {
position: absolute;
Expand Down Expand Up @@ -452,3 +460,4 @@ $(".body-damage-title").html(data.pDamage + "%");
.body-damage-container:hover .body-damage-line {
opacity: 1;
}
```