Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New stock to add to smlib #52

Open
eyal282 opened this issue Sep 25, 2018 · 0 comments
Open

New stock to add to smlib #52

eyal282 opened this issue Sep 25, 2018 · 0 comments

Comments

@eyal282
Copy link

eyal282 commented Sep 25, 2018

stock Handle:FindPluginByName(const String:PluginName[], bool:Sensitivity=true, bool:Contains=false)
{
new Handle:iterator = GetPluginIterator();

new Handle:PluginID;

new String:curName[PLATFORM_MAX_PATH];

while(MorePlugins(iterator))
{
	PluginID = ReadPlugin(iterator)
	GetPluginInfo(PluginID, PlInfo_Name, curName, sizeof(curName));

	if(StrEqual(PluginName, curName, Sensitivity) || (Contains && StrContains(PluginName, curName, Sensitivity) != -1))
	{
		CloseHandle(iterator);
		return PluginID;
	}
}

CloseHandle(iterator);
return INVALID_HANDLE;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant