[release]Simple !warp [charcter] block

Results 1 to 10 of 10
  1. #1
    Apprentice raptor34 is offline
    MemberRank
    Aug 2008 Join Date
    10Posts

    [release]Simple !warp [charcter] block

    Code:
            } else if (splitted[0].equals("!warp")) {
                MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                if (victim != null) {
                    if (victim.getId() == 30003) {
                    	mc.dropMessage("You cannot warp to BEXX");
                        MapleMap target = cserv.getMapFactory().getMap(91000000);
                    }
                        if (victim.getId() == 30001) {
                        	mc.dropMessage("You cannot warp to UrbanDawg");
                            MapleMap target = cserv.getMapFactory().getMap(91000000);
                        }
                        if (splitted.length == 2) {
                            MapleMap target = victim.getMap();
                            c.getPlayer().changeMap(target, target.findClosestSpawnpoint(victim.getPosition()));
                            if (c.getPlayer().getMap().getId() == 1 || c.getPlayer().getMap().getId() == 2) {
                                c.getSession().write(MaplePacketCreator.showApple());
                            }
    Where highlighted red, insert that below " if (victim != null) {" Change the char.id to the character you dont want people to warp to, and have a dropmessage of your choice. Simple! (BTW, needs compiling.. duh!)

    Btw, "MapleMap target = cserv.getMapFactory().getMap(91000000);" doesnt do anything but make !warp function wrong... but hey, it stops the warp lol. It still allows you to warp to other people, and other places though.. dont worry. if anyone has a cleaner way to stop the warp, post below please...

    OH! and if someone knows how to prevent people warping to a certain map, let me know as well please! Ive got like, a kind of private room in my server, where u should only be able to get in through an NPC that checks if u have a valid char.ID lol. i want it to be 100% private with no !warps from nub gms... lol

    Cheers!
    Last edited by raptor34; 14-01-09 at 10:54 PM. Reason: yano..


  2. #2
    Account Upgraded | Title Enabled! RMZero213 is offline
    MemberRank
    Apr 2008 Join Date
    Far, far awayLocation
    1,280Posts

    Re: [release]Simple !warp [charcter] block

    Code:
                    if (victim.getId() == something) {
                    	mc.dropMessage("You cannot warp to " + victim.getName());
                            return;
                    }
    because yours doesn't work, it warps anyways

  3. #3
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [release]Simple !warp [charcter] block

    PHP Code:
            } else if (splitted[0].equals("!warp")) {
                
    MapleCharacter victim cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                if (
    victim != null) {
                    if (
    victim.getId() == 30003 || victim.getId() == 30001) {
                        
    mc.dropMessage("You cannot warp to" splitted[1]);
                    }else{
                        if (
    splitted.length == 2) {
                            
    MapleMap target victim.getMap();
                            
    c.getPlayer().changeMap(targettarget.findClosestSpawnpoint(victim.getPosition()));
                            if (
    c.getPlayer().getMap().getId() == || c.getPlayer().getMap().getId() == 2) {
                                
    c.getSession().write(MaplePacketCreator.showApple());
                            }
                       }
                    }
              }


  4. #4
    Infraction Banned MrMysterious is offline
    MemberRank
    Dec 2008 Join Date
    In a treeLocation
    752Posts

    Re: [release]Simple !warp [charcter] block

    Quote Originally Posted by raptor34 View Post
    Btw, "MapleMap target = cserv.getMapFactory().getMap(91000000);" doesnt do anything but make !warp function wrong...
    Wrong...


    Quote Originally Posted by raptor34 View Post
    OH! and if someone knows how to prevent people warping to a certain map, let me know as well please! Ive got like, a kind of private room in my server, where u should only be able to get in through an NPC that checks if u have a valid char.ID lol. i want it to be 100% private with no !warps from nub gms... lol
    Cheers
    errr... ? if(splitted[whatever] != mapid) o____O

  5. #5
    Account Upgraded | Title Enabled! iamSTEVE is offline
    MemberRank
    Jul 2008 Join Date
    528Posts

    Re: [release]Simple !warp [charcter] block

    Simpler and actually works would be Antlan's way or this would work fine too
    Code:
            } else if (splitted[0].equals("!warp")) {
                MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                if (victim != null && !victim.getName().equals("NAMEHERE")) {
                        if (splitted.length == 2) {
                            MapleMap target = victim.getMap();
                            c.getPlayer().changeMap(target, target.findClosestSpawnpoint(victim.getPosition()));
                            if (c.getPlayer().getMap().getId() == 1 || c.getPlayer().getMap().getId() == 2) {
                                c.getSession().write(MaplePacketCreator.showApple());
                            }

  6. #6
    Apprentice raptor34 is offline
    MemberRank
    Aug 2008 Join Date
    10Posts

    Re: [release]Simple !warp [charcter] block

    Code:
                    	if (victim.getId() == 30003 || victim.getId() == 30001) {
                        mc.dropMessage("You cannot warp to" + splitted[1]);
    This doesnt work, because all it says is get that character, drop a message, and warp to them. LOL
    mine worked for some reason, i dont know... but it worked o.o

    FYI, im a complete nub at java, i dont know what im doing, its all trial and error... haha im trying to make sence of all this rubbish LOL

  7. #7
    Alpha Member ch1nkayy is offline
    MemberRank
    Apr 2008 Join Date
    2,145Posts

    Re: [release]Simple !warp [charcter] block

    deleted post.
    Last edited by ch1nkayy; 16-06-10 at 10:51 PM.

  8. #8
    Infraction Banned XxOsirisxX is offline
    MemberRank
    Jul 2008 Join Date
    2,456Posts

    Re: [release]Simple !warp [charcter] block

    Quote Originally Posted by raptor34 View Post
    Code:
                    	if (victim.getId() == 30003 || victim.getId() == 30001) {
                        mc.dropMessage("You cannot warp to" + splitted[1]);
    This doesnt work, because all it says is get that character, drop a message, and warp to them. LOL
    mine worked for some reason, i dont know... but it worked o.o

    FYI, im a complete nub at java, i dont know what im doing, its all trial and error... haha im trying to make sence of all this rubbish LOL
    nah, I just put "splitted[1]" because is the same as getName() (in this case) and i spected someone would says "getName()" so i wanted it to be different. It will not warp, since i place an "Else" so, if it's not the charID's it will do the normal warping.

  9. #9
    Member Bliss is offline
    MemberRank
    Jul 2008 Join Date
    66Posts

    Re: [release]Simple !warp [charcter] block

    I'm not sure but couldn't you just add a symbol to your name via MySQL database to make you un warpable? or does this not work?

  10. #10
    Proficient Member llammaboi is offline
    MemberRank
    Apr 2008 Join Date
    My Home.Location
    194Posts

    Re: [release]Simple !warp [charcter] block

    Quote Originally Posted by Bliss View Post
    I'm not sure but couldn't you just add a symbol to your name via MySQL database to make you un warpable? or does this not work?
    It would also make you un-whisperable. And if anyone ever need to use you name to join a party / guild, you couldn't join.



Advertisement