Jump to content

Recommended Posts

  • Premium
Posted (edited)

map.gif

Hi developers!

I want to add a feature to my file that automatically redirects me to the login screen when I walk to the edge of the map. Should I put this in the clientSrc, gameSrc, or Python section?

I've tried searching for this question but haven't found any relevant articles. If you know how, could you please tell me how to add the code? Thank you.

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/34431-map-restrictions-edge-code/
Share on other sites

  • Premium
  • Solution
		{
			const LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(ch->GetMapIndex());
			if (pkMap)
			{
				const TMapSetting& s = pkMap->m_setting;
				const long lMapMaxX = s.iBaseX + s.iWidth;
				const long lMapMaxY = s.iBaseY + s.iHeight;

				if (pinfo->lX < s.iBaseX || pinfo->lX >= lMapMaxX ||
					pinfo->lY < s.iBaseY || pinfo->lY >= lMapMaxY)
				{
					sys_log(0, "MAP_EDGE: %s reached map boundary at (%ld, %ld), disconnecting", ch->GetName(), pinfo->lX, pinfo->lY);
					ch->GetDesc()->DelayedDisconnect(0);
					return;
				}
			}
		}

add after

ch->SetRotation(pinfo->bRot * 5);

ch->ResetStopTime();

  • Good 1


 

Link to comment
https://metin2.dev/topic/34431-map-restrictions-edge-code/#findComment-174976
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.