mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
Remove DLL, everything is in lua now
This commit is contained in:
+1
-2
@@ -2,7 +2,6 @@ resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
|
||||
|
||||
description 'SkinChanger'
|
||||
|
||||
client_scripts {
|
||||
'skinchanger.net.dll',
|
||||
client_scripts {,
|
||||
'client/main.lua'
|
||||
}
|
||||
+41
-4
@@ -42,6 +42,39 @@ for i=1, #Components, 1 do
|
||||
Character[Components[i].name] = Components[i].value
|
||||
end
|
||||
|
||||
function LoadDefaultModel(loadMale)
|
||||
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
local characterModel
|
||||
|
||||
if loadMale then
|
||||
characterModel = GetHashKey('mp_m_freemode_01')
|
||||
else
|
||||
characterModel = GetHashKey('mp_f_freemode_01');
|
||||
end
|
||||
|
||||
RequestModel(characterModel)
|
||||
|
||||
Citizen.CreateThread(function()
|
||||
|
||||
while not HasModelLoaded(characterModel) do
|
||||
RequestModel(characterModel)
|
||||
Citizen.Wait(0)
|
||||
end
|
||||
|
||||
if IsModelInCdimage(characterModel) and IsModelValid(characterModel) then
|
||||
SetPlayerModel(PlayerId(), characterModel)
|
||||
SetPedDefaultComponentVariation(playerPed)
|
||||
end
|
||||
|
||||
SetModelAsNoLongerNeeded(characterModel)
|
||||
|
||||
TriggerEvent('skinchanger:modelLoaded')
|
||||
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function GetMaxVals()
|
||||
|
||||
local playerPed = GetPlayerPed(-1)
|
||||
@@ -134,6 +167,10 @@ function ApplySkin(skin, clothes)
|
||||
|
||||
end
|
||||
|
||||
AddEventHandler('skinchanger:loadDefaultModel', function(loadMale)
|
||||
LoadDefaultModel(loadMale)
|
||||
end)
|
||||
|
||||
AddEventHandler('skinchanger:getData', function(cb)
|
||||
|
||||
local components = json.decode(json.encode(Components))
|
||||
@@ -189,9 +226,9 @@ AddEventHandler('skinchanger:loadSkin', function(skin)
|
||||
LoadSkin = skin
|
||||
|
||||
if skin['sex'] == 0 then
|
||||
TriggerEvent('skinchanger:LoadDefaultModel', true)
|
||||
LoadDefaultModel(true)
|
||||
else
|
||||
TriggerEvent('skinchanger:LoadDefaultModel', false)
|
||||
LoadDefaultModel(false)
|
||||
end
|
||||
|
||||
LastSex = skin['sex']
|
||||
@@ -207,9 +244,9 @@ AddEventHandler('skinchanger:loadClothes', function(playerSkin, clothesSkin)
|
||||
}
|
||||
|
||||
if playerSkin['sex'] == 0 then
|
||||
TriggerEvent('skinchanger:LoadDefaultModel', true)
|
||||
LoadDefaultModel(true)
|
||||
else
|
||||
TriggerEvent('skinchanger:LoadDefaultModel', false)
|
||||
LoadDefaultModel(false)
|
||||
end
|
||||
|
||||
LastSex = skin['sex']
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26403.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "skinchanger", "skinchanger\skinchanger.csproj", "{0B36C12C-4C7A-4C24-B204-161034340C8A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0B36C12C-4C7A-4C24-B204-161034340C8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0B36C12C-4C7A-4C24-B204-161034340C8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0B36C12C-4C7A-4C24-B204-161034340C8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0B36C12C-4C7A-4C24-B204-161034340C8A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Les informations générales relatives à un assembly dépendent de
|
||||
// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
|
||||
// associées à un assembly.
|
||||
[assembly: AssemblyTitle("es_skinchanger")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("es_skinchanger")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
|
||||
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
|
||||
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
|
||||
[assembly: Guid("0b36c12c-4c7a-4c24-b204-161034340c8a")]
|
||||
|
||||
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
|
||||
//
|
||||
// Version principale
|
||||
// Version secondaire
|
||||
// Numéro de build
|
||||
// Révision
|
||||
//
|
||||
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
||||
// en utilisant '*', comme indiqué ci-dessous :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,58 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CitizenFX.Core;
|
||||
using CitizenFX.Core.UI;
|
||||
using CitizenFX.Core.Native;
|
||||
|
||||
namespace skinchanger
|
||||
{
|
||||
public class Main : BaseScript
|
||||
{
|
||||
public Main()
|
||||
{
|
||||
Tick += OnTick;
|
||||
|
||||
EventHandlers["skinchanger:LoadDefaultModel"] += new Action<dynamic>(async (dynamic LoadMale) =>
|
||||
{
|
||||
await LoadDefaultModel((bool) LoadMale);
|
||||
|
||||
TriggerEvent("skinchanger:modelLoaded");
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public async Task LoadDefaultModel(bool LoadMale)
|
||||
{
|
||||
|
||||
PedHash CharacterModel;
|
||||
|
||||
if (LoadMale)
|
||||
CharacterModel = PedHash.FreemodeMale01;
|
||||
else
|
||||
CharacterModel = PedHash.FreemodeFemale01;
|
||||
|
||||
Model characterModel = new Model(CharacterModel);
|
||||
|
||||
characterModel.Request(500);
|
||||
|
||||
if (characterModel.IsInCdImage && characterModel.IsValid)
|
||||
{
|
||||
while (!characterModel.IsLoaded)
|
||||
await BaseScript.Delay(0);
|
||||
|
||||
Function.Call(Hash.SET_PLAYER_MODEL, Game.Player, characterModel.Hash);
|
||||
Function.Call(Hash.SET_PED_DEFAULT_COMPONENT_VARIATION, Game.Player.Character.Handle);
|
||||
}
|
||||
|
||||
characterModel.MarkAsNoLongerNeeded();
|
||||
}
|
||||
|
||||
public async Task OnTick()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0B36C12C-4C7A-4C24-B204-161034340C8A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>skinchanger</RootNamespace>
|
||||
<AssemblyName>skinchanger.net</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CitizenFX.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="skinchanger.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy /y "$(TargetPath)" "C:\Users\NGD\Desktop\cfx-server\resources\skinchanger"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ReferencePath>C:\Users\NGD\AppData\Local\FiveM\FiveM.app\citizen\clr2\lib\mono\4.5\</ReferencePath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user