Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: ayuda con la Source de la Season 8 CustomGloves  (Visto 622 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline bruno68 Posteado: October 13, 2019, 01:43:03 AM | Modificado: October 13, 2019, 02:47:34 AM by ZabiinoOo

  • 3D Maker
  • 0 puntos por ventas
  • *
  • Rank: Avanzado
  • Posts: 129
  • Gracias recibida: 10813
  • br
Citar
CustomGloves.h

Citar
#pragma once

#define MAX_CUSTOM_GLOVES   100

struct CUSTOM_RF_GLOVES
{
   int Index;
   int ItemIndex;
   char ModelName[32];
   int TextureLeftIndex;
   char TextureLeftName[32];
   int TextureRightIndex;
   char TextureRightName[32];
};

class cCustomGloves
{
public:
   cCustomGloves();
   virtual ~cCustomGloves();
   void Init();
   void Load(CUSTOM_RF_GLOVES* info);
   void SetInfo(CUSTOM_RF_GLOVES info);
   CUSTOM_RF_GLOVES* GetInfoByID(int index);
   void AssocGloves(char* This);
   bool CheckGloves(int ItemID);
public:
   CUSTOM_RF_GLOVES m_CustomGlovesInfo[MAX_CUSTOM_GLOVES];
}; extern cCustomGloves gCustomGloves;


Citar
CustomGloves.cpp
Citar
#include "stdafx.h"
#include "CustomGloves.h"
#include "Item.h"

cCustomGloves gCustomGloves;

cCustomGloves::cCustomGloves() // OK
{
   this->Init();
}

cCustomGloves::~cCustomGloves() // OK
{

}

void cCustomGloves::Init() // OK
{
   for(int n=0;n < MAX_CUSTOM_GLOVES;n++)
   {
      this->m_CustomGlovesInfo[n].Index = -1;
   }
}

void cCustomGloves::Load(CUSTOM_RF_GLOVES* info) // OK
{
   for(int n=0;n < MAX_CUSTOM_GLOVES;n++)
   {
      this->SetInfo(info[n]);
   }
}

void cCustomGloves::SetInfo(CUSTOM_RF_GLOVES info) // OK
{
   if(info.Index < 0 || info.Index >= MAX_CUSTOM_GLOVES)
   {
      return;
   }

   this->m_CustomGlovesInfo[info.Index] = info;
}

CUSTOM_RF_GLOVES* cCustomGloves::GetInfoByID(int index)
{
   for (int i=0;i<MAX_CUSTOM_GLOVES; i++)
   {
      if (this->m_CustomGlovesInfo.Index == -1)
      {
         continue;
      }

      if (i == index)
      {
         return &this->m_CustomGlovesInfo;
      }
   }

   return 0;
}

#define sub_50D810_Addr      ((int(__thiscall*)(int a1, int a2, int a3, int a4)) 0x50D810)
#define sub_512D50_Addr      ((void*(__thiscall*)(void* a1)) 0x512D50)
#define sub_513C60_Addr      ((char*(__thiscall*)(char *This, void *a2, int a3)) 0x513C60)
#define sub_5135F0_Addr      ((char*(__thiscall*)(DWORD *This, int a2, int a3)) 0x5135F0)
#define sub_512D60_Addr      ((void(*)()) 0x512D60)

void cCustomGloves::AssocGloves(char* This)
{
   for (int i=0;i<MAX_CUSTOM_GLOVES; i++)
   {
      if (this->m_CustomGlovesInfo.Index == -1)
      {
         continue;
      }

      //LoadItemModel(0x4BC,"Custom\\Item\\RFGloves\\","Sword41",-1);
      //LoadItemModel(0x610,"Custom\\Item\\RFGloves\\","Sword41L",-1);
      //LoadItemModel(0x611,"Custom\\Item\\RFGloves\\","Sword41R",-1);

      //LoadItemModel(this->m_CustomGlovesInfo.ItemIndex+ITEM_BASE_MODEL,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.ModelName,-1);
      //LoadItemModel(this->m_CustomGlovesInfo.TextureLeftIndex,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.TextureLeftName,-1);
      //LoadItemModel(this->m_CustomGlovesInfo.TextureRightIndex,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.TextureRightName,-1);

      //LoadItemTexture(this->m_CustomGlovesInfo.ItemIndex+ITEM_BASE_MODEL,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.ModelName,-1);
      //LoadItemTexture(this->m_CustomGlovesInfo.TextureLeftIndex,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.TextureLeftName,-1);
      //LoadItemTexture(this->m_CustomGlovesInfo.TextureRightIndex,"Custom\\Item\\RFGloves\\",this->m_CustomGlovesInfo.TextureRightName,-1);

      sub_50D810_Addr((int)(This + 92), this->m_CustomGlovesInfo.ItemIndex+ITEM_BASE_MODEL, this->m_CustomGlovesInfo.TextureLeftIndex, this->m_CustomGlovesInfo.TextureRightIndex);
      void* v2 = sub_512D50_Addr(This + 92);
      char* v3 = sub_513C60_Addr(This, v2, (int)(This + 92));
      sub_5135F0_Addr((DWORD *)This + 15, (int)This, (int)v3);
      sub_512D60_Addr();
   }
}


bool cCustomGloves::CheckGloves(int ItemID)
{
   for (int i=0;i<MAX_CUSTOM_GLOVES; i++)
   {
      if (this->m_CustomGlovesInfo.Index == -1)
      {
         continue;
      }

      if (ItemID == this->m_CustomGlovesInfo.ItemIndex)
      {
         return true;
      }
   }
   return false;
}


Online ZabiinoOo #1 Posteado: October 13, 2019, 01:54:19 AM

  • MAESTRO

  • US. DE HONOR

  • LEYENDA

  • Administrador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 7.270
  • Gracias recibida: 125195
  • pe
Esto es un fix o un pedido de ayuda sobre algun error?




Prohibido pedir soporte via MP
Leer las reglas de cada seccion
we trust god

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
0 Replies
593 Views
Last post September 28, 2019, 11:30:48 PM
by bruno68
2 Replies
847 Views
Last post October 22, 2019, 03:57:44 PM
by melo920
16 Replies
2141 Views
Last post April 21, 2020, 07:43:22 AM
by erickmalfoy
1 Replies
412 Views
Last post February 23, 2024, 01:54:42 PM
by jorge2016
2 Replies
401 Views
Last post March 30, 2021, 02:24:53 PM
by darblade34