Raised This Month: $32 Target: $400
 8% 

Read plugin version from another one


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 09-24-2012 , 08:19   Read plugin version from another one
Reply With Quote #1

Is it possible to read the version of a certain plugin and then register another plugin with the same version?

First plugin

PHP Code:
new const g_pluginversion[ ] = "2.1";

register_plugin"Main plugin"g_pluginversion"KronoS # GG" ); 
Second plugin

PHP Code:
register_plugin"Second plugin""how_to_get_the_first_plugin_version?""KronoS # GG" ); 

Last edited by ROKronoS; 09-24-2012 at 08:20.
ROKronoS is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-24-2012 , 08:32   Re: Read plugin version from another one
Reply With Quote #2

Create mysql database, create table, save version, plugin get table information! (sqlx)
__________________
kiki33hun is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-24-2012 , 08:41   Re: Read plugin version from another one
Reply With Quote #3

Dynamic natives.
or XVars.
Or even a CVAR. Register it and it can be accessed from any other plugin. Just make sure its AFTER it in the plugins.ini
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 09-24-2012 at 08:46.
Liverwiz is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 09-24-2012 , 09:14   Re: Read plugin version from another one
Reply With Quote #4

http://hg.alliedmods.net/amxmodx-cen...xmodx.inc#l629
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 09-24-2012 , 10:01   Re: Read plugin version from another one
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
I thought i rememberd that function existed....i just couldn't find it on the wiki. And was too lazy to search the incs....
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 09-24-2012 , 12:28   Re: Read plugin version from another one
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
As a matter of fact , could you provide me with an example of how to use it for extracting the plugin version?

@kiki33hun: I don't want to save it within a file/database.
@Liverwiz: Neither with dynamic natives.But thanks for the Xvars , i'll need those for something else.
ROKronoS is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-24-2012 , 16:18   Re: Read plugin version from another one
Reply With Quote #7

Here you go
PHP Code:
new iIndex find_plugin_byfile("first_plugin_name.amxx");
    
new 
szVersion[6];
get_plugin(iIndex, .version szVersion, .len3 charsmax(szVersion)); 
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 09-24-2012 at 16:18.
Alka is offline
ROKronoS
Senior Member
Join Date: Oct 2010
Location: Bucharest, Romania
Old 09-25-2012 , 08:20   Re: Read plugin version from another one
Reply With Quote #8

It's working.Thank you very much
ROKronoS 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 12:36.


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