How to Restrict spawning to a Certain Place

Posts 17 of 7 · Page 1 of 1
How to Restrict spawning to a Certain Place
What this does is restrict spawning to wherever you want just replace "duelarena" with whatever you like

so open up vb or whatever you like and look for /wServer/realm/AdminCommands.cs

look for and add the code below


 
Code
internal class SpawnCommand : Command
{

public SpawnCommand() : base("spawn", 3) { }

protected override bool Process(Player player, RealmTime time, string args)
{

and heres the code you add
 
Code
if (!(player.Owner.Name == "duelarena"))
{
player.SendError("Not Here!");
return false;
}


Hope this helps
you tested this yourself?
yes.
I checked it on seraphs dominion source, After i wrote it.
Quote Originally Posted by retrorealm View Post
What this does is restrict spawning to wherever you want just replace "duelarena" with whatever you like

so open up vb or whatever you like and look for /wServer/realm/AdminCommands.cs

look for and add the code below


 
Code
internal class SpawnCommand : Command
{

public SpawnCommand() : base("spawn", 3) { }

protected override bool Process(Player player, RealmTime time, string args)
{

and heres the code you add
 
Code
if (!(player.Owner.Name == "duelarena"))
{
player.SendError("Not Here!");
return false;
}


Hope this helps
Code:
if (!(player.Owner.Name == "duelarena"))
could be easier to read by making it

Code:
if (player.Owner.Name != "duelarena")
Same result but somewhat easier to understand as it turns up more in the code...

also you can restrict it to Regions as well but it'd require some more advanced code to check the map where the player is located.


Other then that, it could be useful to have as people tend to be.... spawn happy.... when they get a rank
Thanks for the heads up worked like a charm.
Do i add that directly underneath? and do i change the duelarena to nexus if i dont want it to spawn in nexus?
Quote Originally Posted by Filisha View Post
Do i add that directly underneath? and do i change the duelarena to nexus if i dont want it to spawn in nexus?
Please post questions in the help request section. Not as a reply in an ancient thread.
Posts 17 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?