SA-MP Forums Archive
[C++]: Get the name of the AMX. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [C++]: Get the name of the AMX. (/showthread.php?tid=595988)



[C++]: Get the name of the AMX. - SkittlesAreFalling - 10.12.2015

Код:
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad(AMX *amx) {
	if(SERVER::AddAMX(/* GetAMXName(amx), */ amx) == false) {
		return AMX_ERR_GENERAL;
	}
	return amx_Register(amx, Plugin_Natives, -1);
}

PLUGIN_EXPORT int PLUGIN_CALL AmxUnload(AMX *amx) {
	if(SERVER::RemoveAMX(amx) == false) {
		return AMX_ERR_GENERAL;
	}
	return AMX_ERR_NONE;
}
Is there a way to get the name of the AMX that is being loaded?


Re: [C++]: Get the name of the AMX. - codectile - 17.12.2015

I don't think you can get the name of the AMX loaded using the plugin functions but I can tell you that there is another way of doing it. Read the filterscript and gamemode sections in server.cfg as the name of the gamemode has to match with the amx file, then store it in a container.