View Single Post
  #1  
Old 10-28-2004, 04:11 AM
LucidTheStick
Fire Beetle
 
Join Date: Jul 2004
Posts: 12
Default Require a GM_KEY for GM lvl 250 and below

file zone/doors.cpp

after:
Code:
extern Database database;
extern EntityList entity_list;
add:
Code:
//Define GM key item_id:
#define GM_KEY 100001
change:
Code:
if (sender->GetGM())		// GM can always open locks - should probably be changed to require a key
		{
			sender->Message_StringID(4,DOORS_GM);
			if( !IsDoorOpen() || opentype == 58 )
			{ 
				md->action = 0x02; 
			} 
			else
			{ 
				md->action = 0x03; 
			} 
		}
		else if (playerkey)
		{	// they have something they are trying to open it with
			if (keyneeded && keyneeded == playerkey)
			{	// key required and client is using the right key 
				sender->Message(4,"You got it open!");		// more debug spam
				if( !IsDoorOpen() || opentype == 58 )
				{ 
					md->action = 0x02; 
				} 
				else
				{ 
					md->action = 0x03; 
				} 
			}
to:
Code:
if (sender->Admin() > 250)		// GM higher than 250 can always open doors
		{
			sender->Message_StringID(4,DOORS_GM);
			if( !IsDoorOpen() || opentype == 58 )
			{ 
				md->action = 0x02; 
			} 
			else
			{ 
				md->action = 0x03; 
			} 
		}
		else if (playerkey)
		{	// they have something they are trying to open it with
			if (keyneeded && keyneeded == playerkey)
			{	// key required and client is using the right key 
				sender->Message(4,"You got it open!");		// more debug spam
				if( !IsDoorOpen() || opentype == 58 )
				{ 
					md->action = 0x02; 
				}
				else
				{ 
					md->action = 0x03; 
				} 
			}
			else if (GM_KEY == playerkey)		// Player using GM key
			{
				sender->Message_StringID(4,DOORS_GM);
				if( !IsDoorOpen() || opentype == 58 )
				{ 
					md->action = 0x02; 
				} 
				else
				{ 
					md->action = 0x03; 
				} 
			}
There you go.
Not much but I was bored and saw a note about it should require a key not just GM =)

EDIT: Should be fixed to read lvl instead if GM (was REALLY tired. lol)
Reply With Quote