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

Solved How can check author of a plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-25-2017 , 14:52   How can check author of a plugin?
Reply With Quote #1

Example: Get basecomm.smx author. Check author. Or another smx.

Is this possible? If yes, how?
__________________

Last edited by vortex.; 07-25-2017 at 18:01.
vortex. is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-25-2017 , 15:02   Re: How can check author of a plugin?
Reply With Quote #2

this is just an idea and i might be wrong but you could execute sm plugins list and retrieve the console output with https://sm.alliedmods.net/api/index....d=show&id=981&
blacklagoon is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-25-2017 , 15:07   Re: How can check author of a plugin?
Reply With Quote #3

Umm, maybe. But should be a shortcut. Any idea?
__________________
vortex. is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 07-25-2017 , 15:09   Re: How can check author of a plugin?
Reply With Quote #4

GetPluginInfo returns the info from the plugin info struct. Look through functions.inc for other related stuff.
Fyren is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-25-2017 , 15:15   Re: How can check author of a plugin?
Reply With Quote #5

Quote:
Originally Posted by Fyren View Post
GetPluginInfo returns the info from the plugin info struct. Look through functions.inc for other related stuff.
Thank you, but i dont want info for my plugin. I want info for other plugins. This is possible in GetPluginInfo?
__________________
vortex. is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 07-25-2017 , 15:18   Re: How can check author of a plugin?
Reply With Quote #6

You use GetPluginIterator, ReadPlugins, MorePlugins, and GetPluginInfo functions
__________________
blaacky is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-25-2017 , 15:22   Re: How can check author of a plugin?
Reply With Quote #7

Can you write an quick example ._. ?

Like this If "sm plugins" contains Vortéx! (example author), get which plugin so, get the file name.
__________________

Last edited by vortex.; 07-25-2017 at 15:26.
vortex. is offline
MithatGuner
Member
Join Date: Sep 2016
Location: Turkey
Old 07-25-2017 , 15:31   Re: How can check author of a plugin?
Reply With Quote #8

u looking for this?
for other plugins u need to get handle for plugin.
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "Mithat Guner"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo 
{
    
name "Example Plugin",
    
author PLUGIN_AUTHOR,
    
description "Example Plugin",
    
version PLUGIN_VERSION,
    
url "pluginler.com"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_yazar"YAZAR);
}
public 
Action YAZAR(int clientint args)
{
    
char author[64];
    
GetAuthor(authorsizeof(author), INVALID_HANDLE);
    
PrintToChat(client"%s"author);
}
stock void GetAuthor(char[] authorint maxHandle plugin)
{
    
GetPluginInfo(pluginPlInfo_Authorauthormax);


Last edited by MithatGuner; 07-25-2017 at 15:33.
MithatGuner is offline
blacklagoon
Senior Member
Join Date: Jun 2012
Old 07-25-2017 , 15:45   Re: How can check author of a plugin?
Reply With Quote #9

some modified code from powerlord that might not compile, but it gives you a good idea on how to iterate
Code:
char tofind[] = {"Vortéx!"};
char stockpluginname[64];

stock	void	FindPlugin(void)
{
	char pluginAuthor[64];
	Handle pluginIterator = GetPluginIterator();
	while (MorePlugins(pluginIterator))
	{
		static pluginNum;
		new currentPlugin = ReadPlugin(pluginIterator);
		GetPluginInfo(currentPlugin, PlInfo_Author, pluginAuthor, sizeof(pluginAuthor));
		if (StrEqual(tofind, pluginAuthor, false)))
		{
			GetPluginInfo(currentPlugin, PlInfo_Name, stockpluginname, sizeof(stockpluginname));
			return;
		}
		pluginNum++;
	}
}
there's more info here https://forums.alliedmods.net/showthread.php?t=155533

Last edited by blacklagoon; 07-25-2017 at 15:49.
blacklagoon is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 07-25-2017 , 16:05   Re: How can check author of a plugin?
Reply With Quote #10

Quote:
Originally Posted by blacklagoon View Post
some modified code from powerlord that might not compile, but it gives you a good idea on how to iterate
Code:
char tofind[] = {"Vortéx!"};
char stockpluginname[64];

stock	void	FindPlugin(void)
{
	char pluginAuthor[64];
	Handle pluginIterator = GetPluginIterator();
	while (MorePlugins(pluginIterator))
	{
		static pluginNum;
		new currentPlugin = ReadPlugin(pluginIterator);
		GetPluginInfo(currentPlugin, PlInfo_Author, pluginAuthor, sizeof(pluginAuthor));
		if (StrEqual(tofind, pluginAuthor, false)))
		{
			GetPluginInfo(currentPlugin, PlInfo_Name, stockpluginname, sizeof(stockpluginname));
			return;
		}
		pluginNum++;
	}
}
there's more info here https://forums.alliedmods.net/showthread.php?t=155533
Thanks!


Quote:
Originally Posted by MithatGuner View Post
u looking for this?
for other plugins u need to get handle for plugin.
PHP Code:
#pragma semicolon 1

#define DEBUG

#define PLUGIN_AUTHOR "Mithat Guner"
#define PLUGIN_VERSION "1.00"

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public Plugin myinfo 
{
    
name "Example Plugin",
    
author PLUGIN_AUTHOR,
    
description "Example Plugin",
    
version PLUGIN_VERSION,
    
url "pluginler.com"
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_yazar"YAZAR);
}
public 
Action YAZAR(int clientint args)
{
    
char author[64];
    
GetAuthor(authorsizeof(author), INVALID_HANDLE);
    
PrintToChat(client"%s"author);
}
stock void GetAuthor(char[] authorint maxHandle plugin)
{
    
GetPluginInfo(pluginPlInfo_Authorauthormax);

Thank you :p
__________________

Last edited by vortex.; 07-25-2017 at 16:06.
vortex. 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 16:13.


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