Giter Club home page Giter Club logo

mx-multicharacter's Introduction

Multicharacter

Image:

1 2

VIDEO:

https://youtu.be/V87r0_HAujE

Features

  • You can see your character.
  • Slots can be unlocked vip players or everyone.
  • Cinematic intro

F.A.Q

My character is not saved, what should I do?

  • Your character is not saved because es_extended is not triggered. There is currently no solution for this issue.

My character does not appear on the screen or appears as invisible, what should I do?

  • Set skinnothave true in the config. This error is caused because esx_skin is not triggered.

Can I use this script without deleting my previous characters?

  • Yes, if you are not using a multicharacter before, you will not have a problem when you switch to this system.

I'm using extendedmode or a version older than 1.2. Is it supported?

  • I have never used a version older than 1.2. But it's supported.

My character does not appear or every time I open a character, it asks me to open a character again.

  • Customize identifier setting via config.

Requirements

How To Install

  • Open your server.cfg and add ensure mx-multicharacter ensure mx-spawn

  • if using newest esx, es_extended > client > main.lua 3 - 12 lines find

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if NetworkIsPlayerActive(PlayerId()) then
			TriggerServerEvent('esx:onPlayerJoined')
			break
		end
	end
end)
  • change with
-- Citizen.CreateThread(function()
-- 	while true do
-- 		Citizen.Wait(0)

-- 		if NetworkIsPlayerActive(PlayerId()) then
-- 			TriggerServerEvent('esx:onPlayerJoined')
-- 			break
-- 		end
-- 	end
-- end)
  • if using essentialmode, essentialmode > client > main.lua 7 - 17 lines find
Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)

		if NetworkIsSessionStarted() then
			TriggerServerEvent('es:firstJoinProper')
			TriggerEvent('es:allowedToSpawn')
			return
		end
	end
end)
  • change with
-- Citizen.CreateThread(function()
-- 	while true do
-- 		Citizen.Wait(0)

-- 		if NetworkIsSessionStarted() then
-- 			TriggerServerEvent('es:firstJoinProper')
-- 			TriggerEvent('es:allowedToSpawn')
-- 			return
-- 		end
-- 	end
-- end)
  • If you are using esx_identity remove it.

  • And finally add this to the skinchanger > client > main.lua

exports('loadmulticharpeds', function(multipedID, skin)
	local MultiPed = {}
	for i=1, #Components, 1 do
		MultiPed[Components[i].name] = Components[i].value
	end
	for k,v in pairs(skin) do
		MultiPed[k] = v
	end

	SetPedHeadBlendData			(multipedID, MultiPed['face'], MultiPed['face'], MultiPed['face'], MultiPed['skin'], MultiPed['skin'], MultiPed['skin'], 1.0, 1.0, 1.0, true)

	SetPedHairColor				(multipedID,			MultiPed['hair_color_1'],		MultiPed['hair_color_2'])					-- Hair Color
	SetPedHeadOverlay			(multipedID, 3,		MultiPed['age_1'],				(MultiPed['age_2'] / 10) + 0.0)			-- Age + opacity
	SetPedHeadOverlay			(multipedID, 0,		MultiPed['blemishes_1'],		(MultiPed['blemishes_2'] / 10) + 0.0)		-- Blemishes + opacity
	SetPedHeadOverlay			(multipedID, 1,		MultiPed['beard_1'],			(MultiPed['beard_2'] / 10) + 0.0)			-- Beard + opacity
	SetPedEyeColor				(multipedID,			MultiPed['eye_color'], 0, 1)												-- Eyes color
	SetPedHeadOverlay			(multipedID, 2,		MultiPed['eyebrows_1'],		(MultiPed['eyebrows_2'] / 10) + 0.0)		-- Eyebrows + opacity
	SetPedHeadOverlay			(multipedID, 4,		MultiPed['makeup_1'],			(MultiPed['makeup_2'] / 10) + 0.0)			-- Makeup + opacity
	SetPedHeadOverlay			(multipedID, 8,		MultiPed['lipstick_1'],		(MultiPed['lipstick_2'] / 10) + 0.0)		-- Lipstick + opacity
	SetPedComponentVariation	(multipedID, 2,		MultiPed['hair_1'],			MultiPed['hair_2'], 2)						-- Hair
	SetPedHeadOverlayColor		(multipedID, 1, 1,	MultiPed['beard_3'],			MultiPed['beard_4'])						-- Beard Color
	SetPedHeadOverlayColor		(multipedID, 2, 1,	MultiPed['eyebrows_3'],		MultiPed['eyebrows_4'])					-- Eyebrows Color
	SetPedHeadOverlayColor		(multipedID, 4, 1,	MultiPed['makeup_3'],			MultiPed['makeup_4'])						-- Makeup Color
	SetPedHeadOverlayColor		(multipedID, 8, 1,	MultiPed['lipstick_3'],		MultiPed['lipstick_4'])					-- Lipstick Color
	SetPedHeadOverlay			(multipedID, 5,		MultiPed['blush_1'],			(MultiPed['blush_2'] / 10) + 0.0)			-- Blush + opacity
	SetPedHeadOverlayColor		(multipedID, 5, 2,	MultiPed['blush_3'])														-- Blush Color
	SetPedHeadOverlay			(multipedID, 6,		MultiPed['complexion_1'],		(MultiPed['complexion_2'] / 10) + 0.0)		-- Complexion + opacity
	SetPedHeadOverlay			(multipedID, 7,		MultiPed['sun_1'],				(MultiPed['sun_2'] / 10) + 0.0)			-- Sun Damage + opacity
	SetPedHeadOverlay			(multipedID, 9,		MultiPed['moles_1'],			(MultiPed['moles_2'] / 10) + 0.0)			-- Moles/Freckles + opacity
	SetPedHeadOverlay			(multipedID, 10,		MultiPed['chest_1'],			(MultiPed['chest_2'] / 10) + 0.0)			-- Chest Hair + opacity
	SetPedHeadOverlayColor		(multipedID, 10, 1,	MultiPed['chest_3'])														-- Torso Color
	SetPedHeadOverlay			(multipedID, 11,		MultiPed['bodyb_1'],			(MultiPed['bodyb_2'] / 10) + 0.0)			-- Body Blemishes + opacity

	if MultiPed['ears_1'] == -1 then
		ClearPedProp(multipedID, 2)
	else
		SetPedPropIndex			(multipedID, 2,		MultiPed['ears_1'],			MultiPed['ears_2'], 2)						-- Ears Accessories
	end

	SetPedComponentVariation	(multipedID, 8,		MultiPed['tshirt_1'],			MultiPed['tshirt_2'], 2)					-- Tshirt
	SetPedComponentVariation	(multipedID, 11,		MultiPed['torso_1'],			MultiPed['torso_2'], 2)					-- torso parts
	SetPedComponentVariation	(multipedID, 3,		MultiPed['arms'],				MultiPed['arms_2'], 2)						-- Amrs
	SetPedComponentVariation	(multipedID, 10,		MultiPed['decals_1'],			MultiPed['decals_2'], 2)					-- decals
	SetPedComponentVariation	(multipedID, 4,		MultiPed['pants_1'],			MultiPed['pants_2'], 2)					-- pants
	SetPedComponentVariation	(multipedID, 6,		MultiPed['shoes_1'],			MultiPed['shoes_2'], 2)					-- shoes
	SetPedComponentVariation	(multipedID, 1,		MultiPed['mask_1'],			MultiPed['mask_2'], 2)						-- mask
	SetPedComponentVariation	(multipedID, 9,		MultiPed['bproof_1'],			MultiPed['bproof_2'], 2)					-- bulletproof
	SetPedComponentVariation	(multipedID, 7,		MultiPed['chain_1'],			MultiPed['chain_2'], 2)					-- chain
	SetPedComponentVariation	(multipedID, 5,		MultiPed['bags_1'],			MultiPed['bags_2'], 2)						-- Bag

	if MultiPed['helmet_1'] == -1 then
		ClearPedProp(multipedID, 0)
	else
		SetPedPropIndex			(multipedID, 0,		MultiPed['helmet_1'],			MultiPed['helmet_2'], 2)					-- Helmet
	end

	if MultiPed['glasses_1'] == -1 then
		ClearPedProp(multipedID, 1)
	else
		SetPedPropIndex			(multipedID, 1,		MultiPed['glasses_1'],			MultiPed['glasses_2'], 2)					-- Glasses
	end

	if MultiPed['watches_1'] == -1 then
		ClearPedProp(multipedID, 6)
	else
		SetPedPropIndex			(multipedID, 6,		MultiPed['watches_1'],			MultiPed['watches_2'], 2)					-- Watches
	end

	if MultiPed['bracelets_1'] == -1 then
		ClearPedProp(multipedID,	7)
	else
		SetPedPropIndex			(multipedID, 7,		MultiPed['bracelets_1'],		MultiPed['bracelets_2'], 2)				-- Bracelets
	end
	MultiPed = nil
end)

mx-multicharacter's People

Contributors

dhauer avatar icecubepiso avatar moxharth avatar moxhartz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mx-multicharacter's Issues

help please

i just need help saving my palyers when i use it when i leave it wont save i gotta make it again also all perms dont work and idk why

Wrong Last Location & Player dies by reconnecting

Hi
I have an Issue with this script and we dont know how to fix it!
Like said in the Title are joining my Players if there clicking on Last Location, there spawning once in the Grove Street or on the Airport
And everytime a Player joins, this Player dies and becomes a Black & White Screen and we need to revive this Person.

Pls help us. We are a small Server on Five M and were losing Players because of this
Have a Great Day.
Zane

Can't make character

when showing me character selector i can't create new character
I'm using:
es_extended 1.1.0
essentialmode 6.2.2
skinchanger from your resposittory
db wiped
image
image

compatibility with es_extended legacy

I have a problem with the script when creating a player or when starting with a player I get an error that it is extended.

My code

RegisterNetEvent('esx:onPlayerJoined')
AddEventHandler('esx:onPlayerJoined', function()
	while not next(ESX.Jobs) do Wait(50) end

	if not ESX.Players[source] then
		onPlayerJoined(source)
	end
end)
function onPlayerJoined(playerId)
	local identifier = ESX.GetIdentifier(playerId)
	if identifier then
		if ESX.GetPlayerFromIdentifier(identifier) then
			DropPlayer(playerId, ('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(identifier))
		else
			local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
			if result then
				loadESXPlayer(identifier, playerId, false)
			else
				createESXPlayer(identifier, playerId)
			end
		end
	else
		DropPlayer(playerId, 'there was an error loading your character!\nError code: identifier-missing-ingame\n\nThe cause of this error is not known, your identifier could not be found. Please come back later or report this problem to the server administration team.')
	end
end

imagen_2022-04-10_140937

Character selection wrongly rendered

Hi and first of all thanks for your effort on developing this resource!

I am facing an issue with the rendering of the character selection zone.

It is badly rendered, probably it is caused by some other resource, but I'd like to ask if you or someone ever had this strange issue.

this is my behavior:

image

Thank you in advance for your help

Im having trouble installing this. The script makes me stuck on loadingscreen.

Im having trouble installing this. The script makes me stuck on loadingscreen and im getting this error, can you help me?

[ script:es_extended] [WARNING] Server callback "getPlayers" does not exist. Please Check The Server File for Errors!
[script:mx-multichara] MX-MULTICHARACTER: Checking ur identifier
[script:mx-multichara] MX-MULTICHARACTER: No player found on sql.

Character Dont Get Saved

I follow all the instructions, I create my character and I log out and log in and my character dont get safe when I re-logging but it saves himself on the data base users as char1 char2 char3 idk what to do please help. Sorry for my bad english btw

ESX 1.1 issue

Seems to me the way this was wrote it won't work unless I wipe the db or is ther another way I can keep all the users in my commmunity without wiping?

Error Live Console

Hello, a very good script, but i have on issue. Can you plz help?

I have this in the LIVE Console:

[script:mx-multichara] MX-MULTICHARACTER: Checking ur identifier
[ script:mysql-async] [MariaDB:10.3.31-MariaDB-0+deb10u1] [ERROR] [mx-multicharacter] An error happens for query "UPDATE addon_account_data SET owner = 'Char1b2b22533c1d80d820bc324cb4e6963682e1c12a6' WHERE owner = 'b2b22533c1d80d820bc324cb4e6963682e1c12a6' : []": ER_DUP_ENTRY: Duplicate entry 'bank_savings-Char1b2b22533c1d80d820bc324cb4e6963682e1c12a6' for key 'index_addon_account_data_account_name_owner'

[ script:mysql-async] [MariaDB:10.3.31-MariaDB-0+deb10u1] [ERROR] [mx-multicharacter] An error happens for query "UPDATE datastore_data SET owner = 'Char1b2b22533c1d80d820bc324cb4e6963682e1c12a6' WHERE owner = 'b2b22533c1d80d820bc324cb4e6963682e1c12a6' : []": ER_DUP_ENTRY: Duplicate entry 'property-Char1b2b22533c1d80d820bc324cb4e6963682e1c12a6' for key 'index_datastore_data_name_owner'

[ script:mysql-async] [MariaDB:10.3.31-MariaDB-0+deb10u1] [ERROR] [mx-multicharacter] An error happens for query "UPDATE users SET identifier = 'Char1b2b22533c1d80d820bc324cb4e6963682e1c12a6' WHERE identifier = 'b2b22533c1d80d820bc324cb4e6963682e1c12a6' : []": ER_DATA_TOO_LONG: Data too long for column 'identifier' at row 1

event not safe for net

[ script:es_extended] event esx:onPlayerJoined was not safe for net

I'm running on esx legacy with linden inventory etc etc.

This is the only error i receive currently, BUT this happens...

https://i.imgur.com/0N27Qvv.png
https://i.imgur.com/OewUrBj.jpg
https://i.imgur.com/Inhn2M9.jpg

Said loading story mode and never gets passed that screen.

Followed your instructions to the letter, I hear the airport and such when I make my character, but I do NOT see anything more than the "Story mode loading" message and background.

Spawning

Hello, is there any way, how to get peopel spawn only at last location.. i mean witouth that UI. Cuze 1) it's killing the person, before he select and 2) peopel just combat loging and spawn at different location.

Secound character prefix index revert on auto save

I love your resource and thank you for sharing it with us. So i am using extendedmode v1.2. When i create my second character it gets create with the prefix Char2steam:xxxx but after the automatic save it gets reverted back to steam:xxxx and i think this messes things up with last_character and inventory doesnt gets save properly because it created new user with id: steam:xxxxx and new inventory
Screenshot from 2021-09-02 22-24-45
Screenshot from 2021-09-02 22-25-04

Skin Error

Some Skin error, i edit the skin script, this is 2.0

neww

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.