Jump to content

Metin2 | Deathmatch Event


Recommended Posts

M2 Download Center

Download Here ( Internal )

Download Here ( GitHub )

Spoiler

07213498aac84ffd461949600298cd358165a5.p

 

Hello , this is one of my first systems that i made for my pvp server 1-2 years ago and since then i was using it and it has no problems.

I'm not a system's developer i only made things for my servers and this one i want to share with you.

 

 

  • Love 9
Link to post
  • 3 weeks later...

my error - Help Plss: 

 

https://prnt.sc/rb8bfq

 

deathmatch.cpp: In member function 'void CDeathMatchPvP::OnLogin(LPCHARACTER)':
deathmatch.cpp:18:18: error: 'STUN_DEATHMATCH' was not declared in this scope
    ch->AddAffect(STUN_DEATHMATCH, 0, 0, AFF_STUN, 60*60*60*365, 0, 1, 0);
                  ^~~~~~~~~~~~~~~
deathmatch.cpp:25:17: error: 'PK_MODE_DEATHMATCH' was not declared in this scope
   ch->SetPKMode(PK_MODE_DEATHMATCH);
                 ^~~~~~~~~~~~~~~~~~
deathmatch.cpp: In member function 'void FDeleteStun::operator()(LPENTITY)':
deathmatch.cpp:42:24: error: 'STUN_DEATHMATCH' was not declared in this scope
     if (ch->FindAffect(STUN_DEATHMATCH))
                        ^~~~~~~~~~~~~~~
gmake: *** [Makefile:183: .obj/deathmatch.o] Error 1
gmake: *** Waiting for unfinished jobs....

 

Link to post
9 hours ago, shaman21 said:

my error - Help Plss: 

 

https://prnt.sc/rb8bfq

 

deathmatch.cpp: In member function 'void CDeathMatchPvP::OnLogin(LPCHARACTER)':
deathmatch.cpp:18:18: error: 'STUN_DEATHMATCH' was not declared in this scope
    ch->AddAffect(STUN_DEATHMATCH, 0, 0, AFF_STUN, 60*60*60*365, 0, 1, 0);
                  ^~~~~~~~~~~~~~~
deathmatch.cpp:25:17: error: 'PK_MODE_DEATHMATCH' was not declared in this scope
   ch->SetPKMode(PK_MODE_DEATHMATCH);
                 ^~~~~~~~~~~~~~~~~~
deathmatch.cpp: In member function 'void FDeleteStun::operator()(LPENTITY)':
deathmatch.cpp:42:24: error: 'STUN_DEATHMATCH' was not declared in this scope
     if (ch->FindAffect(STUN_DEATHMATCH))
                        ^~~~~~~~~~~~~~~
gmake: *** [Makefile:183: .obj/deathmatch.o] Error 1
gmake: *** Waiting for unfinished jobs....

 

I've got this error too :( 

Link to post
34 minutes ago, Co0L said:

Add those affects in affect.h

I've solved, u need to put the defines in: "commondefines.h" if u got that or in service.h if u don't have it. It depends from the source.

Byee

Link to post
  • 2 weeks later...
  • 8 months later...
  • 2 weeks later...
  • 2 weeks later...
On 12/8/2020 at 10:48 AM, Aeolus said:

Any help please?

you don't have -DNDEBUG as a CFLAG in the makefile (which is ok for test server btw, also because this bug can make some pointers point to the hyperspace and cause crashes for systems that should work and you wouldn't understand how without that check).

Not only that, a CDeathMatchPvP class is being created, but never initialized on main.cpp, and has no constructor and destructor.

to fix:

 

in main.cpp, in the int main(int argc, char **argv) function, you have to declare the new class, ex:

CHorseNameManager	horsename_manager;
//after
CDeathMatchPvP	death_match_pvp;

//[...]
	OXEvent_manager.Initialize();
//add after:
	death_match_pvp.Initialize();
//[...]
	sys_log(0, "<shutdown> Shutting down ITEM_MANAGER...");
	item_manager.GracefulShutdown();
//add after:
	sys_log(0, "<shutdown> Shutting down DeathMatchPvP...");
	death_match_pvp.Destroy();

deathmatch.cpp:

 

  
#include "stdafx.h"
#include "utils.h"
#include "char.h"
#include "char_manager.h"
#include "affect.h"
#include "sectree_manager.h"
#include "packet.h"
#include "deathmatch.h"
#include "locale_service.h"
#include <fstream>
 
//add after
CDeathMatchPvP::CDeathMatchPvP()
: m_bEmpire(0)
{
}

CDeathMatchPvP::~CDeathMatchPvP()
{
	Destroy();
}

void CDeathMatchPvP::Initialize()
{
	m_map_char.clear(); //idk this shit isn't even used, why is it even declared again as a protected member of the class?
}

void CDeathMatchPvP::Destroy()
{
	m_map_char.clear(); //idk this shit isn't even used, why is it even declared again as a protected member of the class?
  	m_bEmpire = 0;
}

deathmatch.h:

class CDeathMatchPvP : public singleton<CDeathMatchPvP>
{
	private :
		std::map<DWORD, DWORD> m_map_char;
	public :
  //add here
		CDecorumManager();
		virtual ~CDecorumManager();
  		void Initialize();
  		void Destroy();

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.