Jump to content

[SHARE]Pm refusal mode for players


Intrepid

Recommended Posts

Easy .pmoff voicedcommand to make the pm refusal mode accessible to players.

Credits to me.

(I know thats a very easy one to make so plz dont comment something like "easy to me" or else...that command only for FUN)

 

Tested and work on L2J ct2.2

 

/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
* 
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* 
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.handler.voicedcommandhandlers;

import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;

/**
* @author Intrepid
*
*/

public class pmoff implements IVoicedCommandHandler
{
private static final String[] VOICED_COMMANDS = 
{ 
	"pmoff"
};

public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
{
	if ((command.startsWith("pmoff")))
	{
		if (activeChar.getMessageRefusal()) // already in message refusal mode
		{
			activeChar.setMessageRefusal(false);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_ACCEPTANCE_MODE));
		}
		else
		{
			activeChar.setMessageRefusal(true);
			activeChar.sendPacket(new SystemMessage(SystemMessageId.MESSAGE_REFUSAL_MODE));
		}
	}
	return true;
}

public String[] getVoicedCommandList()
{
	return VOICED_COMMANDS;
}
}

Link to comment
Share on other sites

Well... nobody said its very easy to make that.

But, /allblock does the exact same thing...

 

i know i know thats why i said just for fun:Pyou know thats more "special" i think because /allblock is work everywhere but find me a server where players can use a gm command(without access ofc):)

Link to comment
Share on other sites

i know i know thats why i said just for fun:Pyou know thats more "special" i think because /allblock is work everywhere but find me a server where players can use a gm command(without access ofc):)

Well, ok. Its good to have those java modifications. :)

BTW you can make commands for trade refusal, duel, party etc.

That would be good.

Link to comment
Share on other sites

Well, ok. Its good to have those java modifications. :)

BTW you can make commands for trade refusal, duel, party etc.

That would be good.

 

hmm good idea when i have some time i start to make them:D

Link to comment
Share on other sites

/allblock

/allunblock

 

anyway gb... and thx for idea

 

you give me one idea :)

 

is for admins... when somene want to send pm to gm/admin and is refusal mode to see the  message xD

 

example :)

Players (NAME): tryed to say you "message" 

 

 

 

Link to comment
Share on other sites

Everyone knew that.Bad post.

you cannot voted for bad post...

seems you can make something better?

he only posted for help and if you are newbie to java you can learn something from these codes...

 

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.



  • Posts

    • Good afternoon everyone, we’ll get a couple of strong players in the CP, more details can be found here https://mw2.community/topic/211276-awr-team/  
    • so i bought this crap of the server few years back and i just found it laying around on my pc and i thought i should share it, if i remember correctly this crap has a lot of bugs that people abuse 🙂   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing source   https://drive.google.com/file/d/13QWg8pi4BPbGbTmlygZ078LjL6Fb0J2a/view?usp=sharing system    
    • Error: Unable to access jarfile libs\Geodata_Converter_v01.jar
    • Since last massive leak as explained as 07/09 (notably all development branches), I don't accept anymore financial newcomers that easily. People will have to contribute 100 cookies worth of contributions (bug reports/fixes) as a first step to be accepted as Donator. Free user can join after sharing over 200 cookies out of contributions, compared to 100 cookies before. You can say thanks to RusAcis, and notably his worthless leader, UnleashedForce. The size of users will continue to shrink if more leaks occur, until true helpers only will be left. New prices are as following : Joining price: 200€ + 100 cookies, or 200 cookies This fee has to be paid if you are joining aCis project. Next month, and all other months, you will have to donate only basic monthly donation. Monthly price: 10€ / 10 cookies This fee has to be paid every month. I won't accept any new join fee before the 100 cookies contribution. Your money will be instantly sent back. Also, in the same shape of idea, actual supporters/donators have to be active to stay in sources. It doesn't have to be a particular amount, you just have to share from time to time *anything*. I don't accept anymore silent ppl. Only useful people will be kept.
    • @Kenrix Hello. my friend bought from you the panel and he told me that he haven't recieved yet his product whats going on?.
  • Topics

×
×
  • Create New...