HomeHome  ­FAQFAQ  ­SearchSearch  ­MemberlistMemberlist  ­UsergroupsUsergroups  ­RegisterRegister  ­Log inLog in  
Post new topic   Reply to topicShare | 
 

 Player Commands

View previous topic View next topic Go down 
AuthorMessage
Flav



Posts: 24
Join date: 2008-08-16

PostSubject: Player Commands   Fri Jan 30, 2009 7:11 pm

Open CommandProcessor.java and look for this line
Code:
if (line.charAt(0) == '!') {

and change it to this
Code:
if (line.charAt(0) == '!' || line.charAt(0) == '@') {

(You can use something else instead of @, but then make sure that you also use something else for your commands.)

Go to net\sf\odinms\client\messages\commands and add the file "PlayerCommands.java" or how ever you want to call it. Create a new Java file:
Code:
/*
   This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
                      Matthias Butz <matze@odinms.de>
                      Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package net.sf.odinms.client.messages.commands;

import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.messages.Command;
import net.sf.odinms.client.messages.CommandDefinition;
import net.sf.odinms.client.messages.IllegalCommandSyntaxException;
import net.sf.odinms.client.messages.MessageCallback;

public class PlayerCommands implements Command {
   @Override
   public void execute(MapleClient c, MessageCallback mc, String[] splitted) throws Exception, IllegalCommandSyntaxException {
        if (splitted[0].equals("@help")) {
            mc.dropMessage("help");
        }
    }

   @Override
   public CommandDefinition[] getDefinition() {
        return new CommandDefinition[] {
            new CommandDefinition("help", "", "", 0),
        };
    }
}


If you give your file another name than PlayerCommands.java, change "PlayerCommands" with the name of your file in this line
Code:
public class PlayerCommands implements Command {

...

Now to explain how it works to use these commands as not GM. You see the 0 at CommandDefinition which says that the "help" (@help) command can be used with the GMLevel 0 which means "not GM".
Back to top Go down
View user profile
 

Player Commands

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
 :: OdinMS :: Releases-
Post new topic   Reply to topic