Jump to content
  • 0

Question

13 answers to this question

Recommended Posts

  • 0
Posted (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 by 'Baggos'
  • 0
Posted (edited)

clientpackets/requestrestartpoint.java

 

check the 'default' value, in _requestedpointtype switch method.

Edited by Klay
  • 0
Posted

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
Posted

 

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
Posted (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 by haskovo
  • 0
Posted (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 by 'Baggos'
  • 0
Posted

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".

Guest
This topic is now closed to further replies.
×
×
  • Create New...