Raised This Month: $ Target: $400
 0% 

plugin pause quest.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kmal2t
BANNED
Join Date: Apr 2006
Old 05-29-2007 , 20:29   plugin pause quest.
Reply With Quote #1

How would I get a plugin to pause itself effectively? I know there are the functions pause, unpause, plugin_pause, and plugin_unpause but it's worthless because if the plugin is renamed it won't pause itself. Is there a way to have the plugin find its own directory and name so I can make that the variable for the second parameter in pause(<flags>, <plugin>)?
kmal2t is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 05-30-2007 , 17:16   Re: plugin pause quest.
Reply With Quote #2

Well if I'm thinking what you're thinking (a plugin that ONLY you can use and anyone who changes the name to avoid being caught with taking it), you could do something like create a FCVAR_SERVER CVAR so that it can be obtained by checking if that cvar is running, then somehow find the name of the plugin by parsing the data returned by maybe an "amxx cvars" like call.

There is probably a better, more effective and less kryptic way, but that's just my two cents :-).

Slmclarengt
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 05-30-2007 , 19:11   Re: plugin pause quest.
Reply With Quote #3

Actually that isn't the idea. I don't care if they rename it considering my name will always be in the register Title and Author. I just want to have it so:

if(conditions not met) { plugin pauses itself by getting its own name then pausing itself OR

if(conditions not met) { ignore all the rest of the plugin after this }
kmal2t is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 05-30-2007 , 19:16   Re: plugin pause quest.
Reply With Quote #4

Well I believe you can do:

Code:
public plugin_init() {      if (conditions not met)              return PLUGIN_CONTINUE      else      {            register_plugin(etc...)      } }

Slmclarengt
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-30-2007 , 19:56   Re: plugin pause quest.
Reply With Quote #5

register_plugin() can safely be left out of any plugin without altering functionality. Just by not calling it will NOT stop the plugin.

Last edited by _Master_; 05-31-2007 at 04:32.
_Master_ is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 05-31-2007 , 02:50   Re: plugin pause quest.
Reply With Quote #6

I think with that double negative you're saying his method won't work. Anyone have a feasible method?
kmal2t is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 05-31-2007 , 04:47   Re: plugin pause quest.
Reply With Quote #7

Depending on your conditions to be met, you could try this in plugin_precache()
Code:
pause("ade")
_Master_ is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 05-31-2007 , 19:39   Re: plugin pause quest.
Reply With Quote #8

That's a really good idea, it works. Ok, now my question is, how would could I get a server's own ip address?
kmal2t is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 06-01-2007 , 01:54   Re: plugin pause quest.
Reply With Quote #9

Not sure of it but try
PHP Code:
static ip[16
PHP Code:
get_user_ip(0ip151
_Master_ is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 06-04-2007 , 15:05   Re: plugin pause quest.
Reply With Quote #10

Just gave this a try and it works, thanks.
kmal2t is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode