Jump to content
  • 0

Custom Respawn Location After Death


iAlreadyExist
 Share

Question

13 answers to this question

Recommended Posts

  • 0

hello there can you give me code for make my server when someone death and when they press to vilage to go my location where i set.

Give a try here...

 

network/clientpackets/RequestRestartPoint.java

                            loc = new Location(17836, 170178, -3507);// Floran Village
                            break;
                        }
-                        loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
-                            break;
-                        }
+                        if (Config.CUSTOM_RESPAWN)
+                            loc = new Location(Config.CSPAWN_X, Config.CSPAWN_Y, Config.CSPAWN_Z);
+                        else
+                            loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
+                        break;
+                }

Config.java

    public static boolean CUSTOM_RESPAWN;
    public static int CSPAWN_X;
    public static int CSPAWN_Y;
    public static int CSPAWN_Z;
 
        CUSTOM_RESPAWN = Boolean.parseBoolean(altSettings.getProperty("RespawnAfterDeath", "false"));
        CSPAWN_X = Double.parseDouble(altSettings.getProperty("SpawnX", "your choose"));
        CSPAWN_Y = Double.parseDouble(altSettings.getProperty("SpawnY", "your choose"));
        CSPAWN_Z = Double.parseDouble(altSettings.getProperty("SpawnZ", "your choose"));

config.property

# Custom Respawn When You Die.
RespawnAfterDeath = false
SpawnX = your choose
SpawnY = your choose
SpawnZ = your choose
Edited by 'Baggos'
Link to comment
Share on other sites

  • 0

i dont understand you can you give me code to add or remove 

i try this http://www.maxcheaters.com/topic/180110-respawn-location-after-death/ butits not working

Link to comment
Share on other sites

  • 0

i dont understand you can you give me code to add or remove 

i try this http://www.maxcheaters.com/topic/180110-respawn-location-after-death/ butits not working

that's what i'm talking about..

 

you probably put that in different case,because it seems fine to me.

Link to comment
Share on other sites

  • 0

 

Give a try here...

 

network/clientpackets/RequestRestartPoint.java

                            loc = new Location(17836, 170178, -3507);// Floran Village
                            break;
                        }
-                        loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
-                            break;
-                        }
+                        if (Config.CUSTOM_RESPAWN)
+                        {
+                            loc = new Location(Config.CSPAWN_X, Config.CSPAWN_Y, Config.CSPAWN_Z);
+                            break;
+                        }
+                }

Config.java

    public static boolean CUSTOM_RESPAWN;
    public static int CSPAWN_X;
    public static int CSPAWN_Y;
    public static int CSPAWN_Z;
 
        CUSTOM_RESPAWN = Boolean.parseBoolean(altSettings.getProperty("RespawnAfterDeath", "false"));
        CSPAWN_X = Double.parseDouble(altSettings.getProperty("SpawnX", "your choose"));
        CSPAWN_Y = Double.parseDouble(altSettings.getProperty("SpawnY", "your choose"));
        CSPAWN_Z = Double.parseDouble(altSettings.getProperty("SpawnZ", "your choose"));

config.property

# Custom Respawn When You Die.
RespawnAfterDeath = false
SpawnX = your choose
SpawnY = your choose
SpawnZ = your choose

that's totally wrong,

what if someone set this config as false?

 

NPE.

 

it needs to be like

 

if (Config.CUSTOM_RESPAWN)
+                            loc = new Location(Config.CSPAWN_X, Config.CSPAWN_Y, Config.CSPAWN_Z);
+else
+                             loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
+
+       break;

 

plus,the code author posted above its correct,but he probably put it in another case,as I said.

Link to comment
Share on other sites

  • 0

that's totally wrong,

what if someone set this config as false?

that's true... i forgot the points with if is false..

Link to comment
Share on other sites

  • 0

well thank you but i dont understand where to put this where is this files Config.java and config.property

 public static boolean CUSTOM_RESPAWN;
    public static int CSPAWN_X;
    public static int CSPAWN_Y;
    public static int CSPAWN_Z;
 
        CUSTOM_RESPAWN = Boolean.parseBoolean(altSettings.getProperty("RespawnAfterDeath", "false"));
        CSPAWN_X = Double.parseDouble(altSettings.getProperty("SpawnX", "your choose"));
        CSPAWN_Y = Double.parseDouble(altSettings.getProperty("SpawnY", "your choose"));
        CSPAWN_Z = Double.parseDouble(altSettings.getProperty("SpawnZ", "your choose"));

and this

# Custom Respawn When You Die.
RespawnAfterDeath = false
SpawnX = your choose
SpawnY = your choose
SpawnZ = your choose
Edited by haskovo
Link to comment
Share on other sites

  • 0

Everywhere you want...

Juts change later the "altsettings" if you add the code in another property..

 

or under from 

    public static boolean ALT_PETS_STATS_BONUS;
+    public static boolean CUSTOM_RESPAWN;
+    public static int CSPAWN_X;
+    public static int CSPAWN_Y;
+    public static int CSPAWN_Z;
 
            ALT_PETS_STATS_BONUS = Boolean.parseBoolean(altSettings.getProperty("AltPetsStatsBonus", "True"));
+            CUSTOM_RESPAWN = Boolean.parseBoolean(altSettings.getProperty("RespawnAfterDeath", "false"));
+            CSPAWN_X = Double.parseDouble(altSettings.getProperty("SpawnX", "your choose"));
+            CSPAWN_Y = Double.parseDouble(altSettings.getProperty("SpawnY", "your choose"));
+            CSPAWN_Z = Double.parseDouble(altSettings.getProperty("SpawnZ", "your choose"));

Don't forget to change the "your choose"

 

altsettings.property

AltPetsStatsBonus = True
+
+# Custom Respawn When You Die.
+RespawnAfterDeath = false
+SpawnX = your choose
+SpawnY = your choose
+SpawnZ = your choose

Don't forget to change the "your choose"

Edited by 'Baggos'
Link to comment
Share on other sites

  • 0

Put this

 

            CSPAWN_X = Integer.parseInt(altSettings.getProperty("SpawnX", "your choose"));
            CSPAWN_Y = Integer.parseInt(altSettings.getProperty("SpawnY", "your choose"));
            CSPAWN_Z = Integer.parseInt(altSettings.getProperty("SpawnZ", "your choose"));

and don't forget to change the "your choose".

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock