DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • August 27, 2016, 07:08:50 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: outputting with hook player-login  (Read 2546 times)
0 Members and 1 Guest are viewing this topic.
MikeMill
Guest
« on: December 08, 2005, 06:52:31 PM »

I'm creating a little personal module that is to be executed when players login.  It is being called just fine however I'm kinda stumped on how I would go about having some text displayed so the player knows the results.  Can anyone please point me in the right direction.

Thanks
Logged
Imperialx
Guest
« Reply #1 on: December 08, 2005, 06:54:12 PM »

Include nessecary core files and use the output(""); function to output text and stuff.
Logged
MikeMill
Guest
« Reply #2 on: December 08, 2005, 08:01:49 PM »

I had already tried that.

The problem is that the player is being redirected to the news page and losing the information I outputted.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5462



View Profile WWW
« Reply #3 on: December 08, 2005, 08:12:45 PM »

What hook are you using, and what are you trying to do for output?
Logged

Play the latest beta version here on DragonPrime
Dannic
Guest
« Reply #4 on: December 08, 2005, 08:23:54 PM »

Maybe if you told us what the module was supposed to do we can give you a good idea on how to implement it.
Logged
MikeMill
Guest
« Reply #5 on: December 08, 2005, 08:26:37 PM »

What hook are you using, and what are you trying to do for output?

hook: player-login (from title Smiley )
Just trying to output the results.  Something as simple as "You gain/lose X Y Z"

Maybe if you told us what the module was supposed to do we can give you a good idea on how to implement it.
The implementation is done, I just wish to be able to display the results.

Currently I'm just sending it via in game mail
« Last Edit: December 08, 2005, 08:27:32 PM by MikeMill » Logged
Dannic
Guest
« Reply #6 on: December 08, 2005, 08:30:28 PM »

I would suggest using a popup then.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5462



View Profile WWW
« Reply #7 on: December 08, 2005, 08:32:18 PM »

I don't think just hooking login would display anything, as the first page the player normally sees is either newday or news if they've already encountered newday.

Sending a single output statement from your module wouldn't appear anywhere, as no page has initialized.

You could try, under your module_run, to put all page elements (header, footer, outputs, globals, etc) to create a new page displayed prior to newday or news.
Logged

Play the latest beta version here on DragonPrime
MikeMill
Guest
« Reply #8 on: December 08, 2005, 08:36:25 PM »

I don't think just hooking login would display anything, as the first page the player normally sees is either newday or news if they've already encountered newday.

Sending a single output statement from your module wouldn't appear anywhere, as no page has initialized.

You could try, under your module_run, to put all page elements (header, footer, outputs, globals, etc) to create a new page displayed prior to newday or news.
Thanks, I'll give that a try.  Would it interfer with any of the other modules using that hook?
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5462



View Profile WWW
« Reply #9 on: December 08, 2005, 08:42:44 PM »

To be honest, I'm not sure; best way to find out is to test and observe...
Logged

Play the latest beta version here on DragonPrime
MikeMill
Guest
« Reply #10 on: December 08, 2005, 08:54:50 PM »

yeah its not calling the _run() function which now that I read the testmodule.php file I'm not surprised about.  For now I'll just leave it with it mailing them.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #11 on: December 08, 2005, 09:04:29 PM »

Thanks, I'll give that a try.  Would it interfer with any of the other modules using that hook?
Yes, it would. Because you had to interrupt the hook-processing.

What you could do is the following:

on "player-login" you set a pref - like "hasloggedin".
on "header-newday" or "header-news" you check, if the pref is set, unset the pref and make your output.

I think, that would be - besides YOMing them - the nicest way Smiley
Logged

Running for more than three years now:
Dannic
Guest
« Reply #12 on: December 09, 2005, 04:03:49 AM »

still think just making a popup in this case is the only way to go if you want the output at player login.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
35 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search