Im trying to brew up a code so that when you login and out it tells people. My code is:
mob/mage
Login()
world <<"\red [usr] logs in!"
usr <<"Welcome to [world.name]!"
Logout()
world <<"\red [usr] logs out!"
usr <<"Thanks for playing [world.name]!"
mob/smage
Login()
world <<"\red [usr] logs in!"
usr <<"Welcome to [world.name]!"
Logout()
world <<"\red [usr] logs out!"
usr <<"Thanks for playing [world.name]!"
And i dont want to have to write it out for ever class...How would i make it so it does it for all the classes with one little code? Please not I tried but failed:
mob
Login()
world <<"\red [usr] logs in!"
usr <<"Welcome to [world.name]!"
Logout()
world <<"\red [usr] logs out!"
usr <<"Thanks for playing [world.name]!"
ID:176579
![]() Dec 31 2002, 10:42 pm
|
|
![]() Dec 31 2002, 10:44 pm
|
|
That would work as long as there was a ..() in the Login() and Logout() procs for the subclasses of mobs.
|
You have one other problem here: usr is only semi-valid in Login(), but it isn't really in Logout(). Login() can be called by someone else too manually, but this is rare; much less rare is for Logout() to be called as a result of someone else's action. Change these to src, which is always correct for those procs, because usr can't be relied on.
Lummox JR |