AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Read plugin version from another one (https://forums.alliedmods.net/showthread.php?t=196685)

ROKronoS 09-24-2012 08:19

Read plugin version from another one
 
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" ); 


kiki33hun 09-24-2012 08:32

Re: Read plugin version from another one
 
Create mysql database, create table, save version, plugin get table information! (sqlx)

Liverwiz 09-24-2012 08:41

Re: Read plugin version from another one
 
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

YamiKaitou 09-24-2012 09:14

Re: Read plugin version from another one
 
http://hg.alliedmods.net/amxmodx-cen...xmodx.inc#l629

Liverwiz 09-24-2012 10:01

Re: Read plugin version from another one
 
Quote:

Originally Posted by YamiKaitou (Post 1805237)

I thought i rememberd that function existed....i just couldn't find it on the wiki. And was too lazy to search the incs....

ROKronoS 09-24-2012 12:28

Re: Read plugin version from another one
 
Quote:

Originally Posted by YamiKaitou (Post 1805237)

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.

Alka 09-24-2012 16:18

Re: Read plugin version from another one
 
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)); 


ROKronoS 09-25-2012 08:20

Re: Read plugin version from another one
 
It's working.Thank you very much :D


All times are GMT -4. The time now is 01:04.

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