Jump to content

nyugione

Inactive Member
  • Posts

    10
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by nyugione

  1. I did this but after i teleported another map I still can't attack
    https://metin2.dev/board/topic/14072-skills-pvp-block-on-specific-maps/

     

    Spoiler
    
    //@svn/Source/Client/UserInterface/PythonPlayerEventHandler.cpp
    //1.) Search:
    void CPythonPlayerEventHandler::OnHit(UINT uSkill, CActorInstance& rkActorVictim, BOOL isSendPacket)
    {
    //2.) Add bellow:
    	static std::string uCurrentMap = CPythonBackground::Instance().GetWarpMapName();
    	static std::string uArrayListOfMaps[] = {
    		"metin2_map_a1",
    		"metin2_map_b1",	/* loaded from atlasinfo.txt */
    		"metin2_map_c1"
    	}; 		
    	
    	for (int i=0;i<_countof(uArrayListOfMaps);i++)
    	{
    		if (rkActorVictim.IsPC() && (!uCurrentMap.compare(uArrayListOfMaps[i])))
    		{
    			TraceError("CPythonPlayerEventHandler::OnHit on map %s was blocked because players is protected.", uArrayListOfMaps[i].c_str());
    			return;
    		}
    	}
    
    //3.) And add on first line or where you want:
    #include "PythonBackground.h"

     


    What is the problem?

    • Metin2 Dev 1
  2. Hi i try this but when i enter the guild and i leave it i cant delete it until I restart the server

    What is the problem?

     

    After this in ClientManagerPlayer.cpp
    
    		char szName[64];
    		strlcpy(szName, row[2], sizeof(szName));
    
    I add this:
    
    		char szQuery[1024];
    		snprintf(szQuery, sizeof(szQuery), "SELECT pid FROM player.guild_member WHERE pid=%u", pi->player_id);
    		std::auto_ptr<SQLMsg> pMsg4(CDBManager::instance().DirectQuery(szQuery));
    		if (pMsg4->Get()->uiNumRows != NULL)
    		{
    			sys_log(0, "PLAYER_DELETE FAILED PLAYER IN GUILD");
    			peer->EncodeHeader(HEADER_DG_PLAYER_DELETE_FAILED, pi->dwHandle, 1);
    			peer->EncodeBYTE(pi->account_index);
    			return;
    		}
    		
    

     

×
×
  • 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.