ID:179074
 
Ok i asked about how to check for the host a while ago, and this was the code i got.

client/New()
..()
if (!src.address || (src.address == world.address))
mob.verbs+= /mob/proc/note2
mob.verbs+= /mob/proc/DisableWarnings2
mob.verbs+= /mob/proc/EnableWarnings2
mob.verbs+= /mob/proc/ChangeServerName2
mob << "Welcome on [OP], thank you for hosting a server!"
OP = "[mob]"
..()
else
.=..()

and it doesnt seem to be working. any idea why?
Umm look at your code. A proc is not a verb also express mob as src
In response to Super16
Super16 wrote:
Umm look at your code. A proc is not a verb also express mob as src

proc can be added to verbs, and i was told to do mob O.o ok ill change that and see if it works.
In response to dbz73
nope still dont work
In response to dbz73
If your code doesnt work then try this it worked in earlier beta.

client/New()
if(world.url==src.address)
src.verbs+=/mob/proc/booo
..()
else
.=..()

In response to Super16
Super16, please refrain from answering any questions here until you know what you're talking about. You've repeatedly answered "host check" questions here with completely incorrect information. This is at least the third time, and I'm probably missing some as I haven't had time to read the forums much lately. I hate to sound harsh, but you're hurting, not helping here.

As for the actual problem, the code looks good for the most part. You also need to check for the case that src.address == "127.0.0.1" in case the person is using DreamDaemon to host. Your if statement should look like this:
if (!src.address || (src.address == world.address) || (src.address == "127.0.0.1"))

You might want to use the old "printf" method of debugging if it still doesn't work. Put statements like
world.log << "client.New() for [src], address is \"[src.address]\""

sprinkled in, and maybe something within the if block to indicate whether it tested true. That should help you track down what's really happening.

[link] also has an alternate approach that works for identifying the host.