Thread: [FF2] [Abilities] Move Speed
View Single Post
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 08-22-2015 , 22:08   Re: [Subplugin] Move Speed
Reply With Quote #7

Quote:
Originally Posted by xXDeathreusXx View Post
Besides changing the version number, I don't see any change whatsoever
v1.3.0:
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "freaks/%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.1: Attempt 1
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (!StrContains(buffer, path, false))
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}
v1.3.2: Actually fixed (because i realized i was passing another .ff2 *cough* new Handle:plugin = FindPlugin("ff2_sarysapub3.ff2"); *cough*)
Code:
stock Handle:FindPlugin(String: pluginName[])
{
	new String: buffer[256];
	new String: path[PLATFORM_MAX_PATH];
	new Handle: iter = GetPluginIterator();
	new Handle: pl = INVALID_HANDLE;
	
	while (MorePlugins(iter))
	{
		pl = ReadPlugin(iter);
		Format(path, sizeof(path), "%s.ff2", pluginName);
		GetPluginFilename(pl, buffer, sizeof(buffer));
		if (StrContains(buffer, path, false) >= 0)
			break;
		else
			pl = INVALID_HANDLE;
	}
	
	CloseHandle(iter);

	return pl;
}

stock AMS_InitSubability(bossIdx, clientIdx, const String: pluginName[], const String: abilityName[], const String: prefix[])
{
	new Handle:plugin = FindPlugin("ff2_sarysapub3");
	if (plugin != INVALID_HANDLE)
	{
		new Function:func = GetFunctionByName(plugin, "AMS_InitSubability");
		if (func != INVALID_FUNCTION)
		{
			Call_StartFunction(plugin, func);
			Call_PushCell(bossIdx);
			Call_PushCell(clientIdx);
			Call_PushString(pluginName);
			Call_PushString(abilityName);
			Call_PushString(prefix);
			Call_Finish();
		}
		else
			LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability()");
	}
	else
		LogError("ERROR: Unable to initialize ff2_sarysapub3:AMS_InitSubability(). Make sure this plugin exists!");
}
__________________

Last edited by 93SHADoW; 08-22-2015 at 22:12.
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW