iAlreadyExist Posted March 17, 2015 Posted March 17, 2015 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.
0 'Baggos' Posted March 17, 2015 Posted March 17, 2015 (edited) 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 March 17, 2015 by 'Baggos'
0 Klay Posted March 17, 2015 Posted March 17, 2015 (edited) clientpackets/requestrestartpoint.java check the 'default' value, in _requestedpointtype switch method. Edited March 17, 2015 by Klay
0 iAlreadyExist Posted March 17, 2015 Author Posted March 17, 2015 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
0 Klay Posted March 17, 2015 Posted March 17, 2015 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.
0 Klay Posted March 17, 2015 Posted March 17, 2015 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.
0 'Baggos' Posted March 17, 2015 Posted March 17, 2015 that's totally wrong, what if someone set this config as false? that's true... i forgot the points with if is false..
0 iAlreadyExist Posted March 18, 2015 Author Posted March 18, 2015 (edited) 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 March 18, 2015 by haskovo
0 'Baggos' Posted March 18, 2015 Posted March 18, 2015 (edited) 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 March 18, 2015 by 'Baggos'
0 iAlreadyExist Posted March 18, 2015 Author Posted March 18, 2015 why give me this error http://prikachi.com/images/862/7990862W.png
0 'Baggos' Posted March 18, 2015 Posted March 18, 2015 why give me this error http://prikachi.com/images/862/7990862W.png 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".
Question
iAlreadyExist
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.
13 answers to this question
Recommended Posts