EZ Scripts
DiscordTebex
  • 💡Welcome To EZ Scripts
  • FIVEM
    • 🍀EZ White Widow
      • Config File
      • Add more locations
      • Common Issues
    • 🟣EZ Lean Drug
      • Config File
      • Add more locations
    • ❄️EZ Coke & Crack Drug
      • Config File
      • Add more locations
    • 🔠EZ Plate Changer
      • Config File
    • 📑Ez Lib
      • Config File
    • 🛡️Ez Admin Authority
      • Config File
    • 🫳Ez Item Spawner
      • Config File
      • Permission Check
      • Add Item
      • Get Items
  • RedM
    • 💼EZ Society & Job Meny
      • Config File
      • Exports
      • Syn Society
    • 🌍EZ Fast Travel
      • Config File
    • 🛡️Ez Admin Authority
      • Config File
    • 🍖Ez Consumables
      • Config File
    • 📺Ez HUD
      • Config File
      • Exports and Events
    • 🚷EZ Combat Logging
      • Config File
    • 🗽EZ Life Style
      • Getting Life Style
      • Config File
    • ☢️EZ Radial Menu
      • Config File
    • 🫳Ez Item Spawner
      • Config File
      • Permission Check
      • Add Item
      • Get Items
Powered by GitBook
On this page
  • STEP 1 - Unzip and Add Script To Server
  • STEP 2 - Modify Character Creation
  • STEP 3 - Run SQL
  • [OPTIONAL] STEP 4 - Removing existing starter items & money

Was this helpful?

  1. RedM

EZ Life Style

Allow players to select the life style they want and integrate their choice into other scripts. Give starter items based on player interests, and start them in a location occurring to their lifestyle.

PreviousConfig FileNextGetting Life Style

Last updated 4 months ago

Was this helpful?

STEP 1 - Unzip and Add Script To Server

Unzip the script folder within your server resources folder. Ensure script in server.cfg ... "ensure ez_lifestyle".

STEP 2 - Modify Character Creation

Go to vorp_character/server/server.lua and search for the event "vorpcharacter:saveCharacter". Change/ modify it to add the following code:

-- Check if resourse ez_lifestyle is running
local function CheckLifeStyle()
	if GetResourceState("ez_lifestyle") == "started" then
		return true
	end
	return false
end

RegisterServerEvent("vorpcharacter:saveCharacter", function(data)
	local _source = source
	Core.getUser(_source).addCharacter(data)
	Wait(600)

	local iniPos, iniHead = iniSpawn()
	if CheckLifeStyle() then
		TriggerClientEvent("ez_lifeStyle:openStyles", _source, iniPos, iniHead)
	else
		TriggerClientEvent("vorp:initCharacter", _source, iniPos, iniHead, false)
	end
	SetTimeout(3000, function()
		TriggerEvent("vorp_NewCharacter", _source)
	end)
end)

Just in case if you ever want to remove the script, you do not have to worry about removing the code, as we have made use of the function CheckLifeStyle() to check if the resource is running or not.

If you have renamed the script, make sure to change the name of the resource in the function CheckLifeStyle().

2. Run the SQL file in your database.

STEP 3 - Run SQL

Create the attribute.

ALTER TABLE `characters`
ADD `lifestyle` VARCHAR(50) DEFAULT NULL;

[OPTIONAL] STEP 4 - Removing existing starter items & money

Make sure to remove default cash for new players from vorp_core/config.lua. Furthermore, make sure to remove any default items and weapons from the vorp_inventory/config.lua.

🗽
Download Link
https://github.com/EZ-Scripts/ez_lifestyle/tree/main