Jump to content

Safebox open command in python


Recommended Posts

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

  • Developer

If you don't want to modify your source files, you can simply try the following code at your button function:

import interfaceModule
self.__int = interfaceModule.Interface()
self.__int.MakeInterface()
self.__int.AskSafeboxPassword()
 

Through the game source code you must create a new command at your cmd_general (you can copy and paste the do_click_mall function, however instead of ShowMeMallPassword use ShowMeSafeboxPassword.

when you return 0 and server doesn't boot:

unknown.png

Link to comment
Share on other sites

4 minutes ago, PACI said:

If you don't want to modify your source files, you can simply try the following code at your button function:

import interfaceModule
self.__int = interfaceModule.Interface()
self.__int.MakeInterface()
self.__int.AskSafeboxPassword()
 

Through the game source code you must create a new command at your cmd_general (you can copy and paste the do_click_mall function, however instead of ShowMeMallPassword use ShowMeSafeboxPassword.

I did the source part. I added the command /click_safebox that uses ShowMeSafeboxPassword but when I click the button it displays a message saying "You are away from the storage" and the function is not working.

Link to comment
Share on other sites

Try that, without remove pos.

Command for use:

	def BINARY_Open_Safebox(self):
		net.SendChatPacket("/safebox_open") 

[File: game/cmd.cpp]

ACMD(do_safebox_open);
{ "safebox_open",	do_safebox_open,		0,			POS_DEAD,	GM_PLAYER	},

[File: game/cmd_general.cpp]

ACMD(do_safebox_open)
{
	if (ch->IsOpenSafebox()) {
		ch->ChatPacket(CHAT_TYPE_INFO, "I am not gay, already you have safebox open :(");
		return; }
		
	ch->SetSafeboxOpenPosition();
	ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeSafeboxPassword");
}

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



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