Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: source CustomWaepeons  (Visto 972 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline ConejoMalo Posteado: June 02, 2020, 08:39:39 PM | Modificado: June 02, 2020, 08:44:44 PM by rodrigo117

  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 781
  • Gracias recibida: 7770
  • ar
Buenas tardes gente de tu server mu... hoy les traigo el source del custom warpeons para s6 1.4e... espero les ayude en algo.

Servicios de  Reparacion de bug Files Muemu, desde source y agregados Custom, soporte de configuracion.

Offline ConejoMalo #1 Posteado: June 02, 2020, 08:50:46 PM

  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 781
  • Gracias recibida: 7770
  • ar
parte del getmainnfo.. me olvide de agregar... aqui va

CustomWeapons.ccp
#include "stdafx.h"
#include "CustomWeapons.h"
#include "MemScript.h"

CCustomWeapons gCustomWeapons;

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

CCustomWeapons::~CCustomWeapons() // OK
{

}

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

void CCustomWeapons::Load(char* path)
{
   CMemScript* lpMemScript = new CMemScript;

   if(lpMemScript == 0)
   {
      printf(MEM_SCRIPT_ALLOC_ERROR,path);
      return;
   }

   if(lpMemScript->SetBuffer(path) == 0)
   {
      printf(lpMemScript->GetLastError());
      delete lpMemScript;
      return;
   }

   this->Init();

   try
   {
      while(true)
      {
         if(lpMemScript->GetToken() == TOKEN_END)
         {
            break;
         }

         if(strcmp("end",lpMemScript->GetString()) == 0)
         {
            break;
         }

         CUSTOM_WEAPONS_INFO info;

         memset(&info,0,sizeof(info));

         static int CustomItemIndexCount = 0;

         info.Index = CustomItemIndexCount++;

         info.ItemIndex = lpMemScript->GetNumber();

         info.Type = lpMemScript->GetAsNumber();

         this->SetInfo(info);
      }
   }
   catch(...)
   {
      printf(lpMemScript->GetLastError());
   }

   delete lpMemScript;
}

void CCustomWeapons::SetInfo(CUSTOM_WEAPONS_INFO info) // OK
{
   if(info.Index < 0 || info.Index >= MAX_CUSTOM_WEAPONS)
   {
      return;
   }

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

CustomWeapons.h
#pragma once

#define MAX_CUSTOM_WEAPONS   500

struct CUSTOM_WEAPONS_INFO
{
   int Index;
   int ItemIndex;
   BYTE Type;
};

class CCustomWeapons
{
public:
   CCustomWeapons();
   virtual ~CCustomWeapons();
   void Init();
   void Load(char* path);
   void SetInfo(CUSTOM_WEAPONS_INFO info);
public:
   CUSTOM_WEAPONS_INFO m_CustomWeaponsInfo[MAX_CUSTOM_WEAPONS];
};

extern CCustomWeapons gCustomWeapons;

getmaininfo.ccp

#include "CustomWeapons.h"

CUSTOM_WEAPONS_INFO CustomWeapons[MAX_CUSTOM_WEAPONS];

gCustomWeapons.Load("CustomWeapons.txt");

memcpy(info.CustomWeapons, gCustomWeapons.m_CustomWeaponsInfo, sizeof(info.CustomWeapons));

Servicios de  Reparacion de bug Files Muemu, desde source y agregados Custom, soporte de configuracion.

Offline onlinezajzaj #2 Posteado: June 02, 2020, 10:29:49 PM

  • MAESTRO

  • Colaborador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 690
  • Gracias recibida: 17919
  • vn
Image Demo, Friend ?

@RODRIGO 117

Chuyên cung cấp Server MU -  Dạy dev MU online - Giá rẻ.
TEACHER MU ONLINE VIỆT NAM / TRAO ĐỔI KINH NGHIỆM MU ONLINE TOP 1 tại VIỆT NAM
WhatApps/Zalo : +886983042918 - ONLINEZAJZAJ : https://zalo.me/caongochavt
https://www.paypal.me/teacherzajzaj

Offline ConejoMalo #3 Posteado: June 02, 2020, 10:52:59 PM

  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 781
  • Gracias recibida: 7770
  • ar
Image Demo, Friend ?

@RODRIGO 117
dont need image is simple...  index   indextipe and bytetipe ( 1, 2 ,3 or 4) read de source...

Servicios de  Reparacion de bug Files Muemu, desde source y agregados Custom, soporte de configuracion.

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
8 Replies
4707 Views
Last post January 02, 2022, 09:49:27 AM
by massironimatias
0 Replies
986 Views
Last post November 02, 2017, 11:47:53 PM
by seedmaker
2 Replies
1924 Views
Last post February 27, 2018, 11:02:35 AM
by LucasHz
5 Replies
2105 Views
Last post December 11, 2019, 08:09:59 PM
by MrRastaman
0 Replies
1122 Views
Last post February 15, 2020, 12:01:26 AM
by levanhau03