SA-MP Forums Archive
[FilterScript] Easy Load/Unload/Reload FS ingame - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Easy Load/Unload/Reload FS ingame (/showthread.php?tid=448727)



Easy Load/Unload/Reload FS ingame - redreaper666 - 05.07.2013

Hi guys.
As i am sick of having to Load/Unload/Reload any FS i want through the rcon or console i made myself a little script that also might can help you out.
With it you can Load/Unload/Reload any Filterscript way faster.

Command Usement:
/loadfs/unloadfs/reloadfs fsname

Код:
//   Easy Load/Unload/Reload FS System By Redreaper666 || V1.0
//----------------------- INCLUDES ---------------------------------------------
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <foreach>
//----------------------- DEFINES ----------------------------------------------
#define COLOR_RED 0xDD0000AA
#define COLOR_GREEN 0x008000FF
//----------------------- STOCKS ----------------------------------------------
stock GetName(playerid)
{
    new PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
	return PlayerName;
}
//------------------------------------------------------------------------------
CMD:reloadfs(playerid, params[])
{
	new string[128],string2[128];
	new fsname;
	if(sscanf(params, "s[30]", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/reloadfs <fsname>");
	format(string,sizeof(string),"%s reloaded Filterscript: %s",GetName(playerid),fsname);
	format(string2,sizeof(string2),"reloadfs %s",fsname);
	SendRconCommand(string2);
	foreach(Player, i)
	{
	SendClientMessage(i,COLOR_GREEN,string);
	}
	return 1;
}
//------------------------------------------------------------------------------
CMD:loadfs(playerid, params[])
{
	new string[128],string2[128];
	new fsname;
	if(sscanf(params, "s[30]", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/loadfs <fsname>");
	format(string,sizeof(string),"%s loaded Filterscript: %s",GetName(playerid),fsname);
	format(string2,sizeof(string2),"loadfs %s",fsname);
	SendRconCommand(string2);
	foreach(Player, i)
	{
	SendClientMessage(i,COLOR_GREEN,string);
	}
	return 1;
}
//------------------------------------------------------------------------------
CMD:unloadfs(playerid, params[])
{
	new string[128],string2[128];
	new fsname;
	if(sscanf(params, "s[30]", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/unloadfs <fsname>");
	format(string,sizeof(string),"%s unloaded Filterscript: %s",GetName(playerid),fsname);
	format(string2,sizeof(string2),"unloadfs %s",fsname);
	SendRconCommand(string2);
	foreach(Player, i)
	{
	SendClientMessage(i,COLOR_RED,string);
	}
	return 1;
}
//------------------------------------------------------------------------------
Bugs:
None known so far.

PS:
Im working on to advance it so that you can get a list which Filterscripts you already got loaded.


Re: Easy Load/Unload/Reload FS ingame - Krakuski - 05.07.2013

Nice Good work.


Re: Easy Load/Unload/Reload FS ingame - DemonRider - 05.07.2013

Awesome , Nice work ++++rep


Re: Easy Load/Unload/Reload FS ingame - sjvt - 05.07.2013

Whats the point?
Just /rcon login password and then /rcon unloadfs name, /rcon loadfs name, /rcon reloadfs name


Respuesta: Easy Load/Unload/Reload FS ingame - JustBored - 05.07.2013

Actually it has a bug, you didnt specified the amount of cells that the string has.
pawn Код:
if(sscanf(params, "s", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/reloadfs <fsname>");
You should put:
pawn Код:
if(sscanf(params, "s[30]", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/reloadfs <fsname>");



Re: Easy Load/Unload/Reload FS ingame - Pottus - 05.07.2013

You could make this a lot better by using a plugin to get all the amx files in the filterscripts folder then just generate a dialog list to select which one to load.


Re: Easy Load/Unload/Reload FS ingame - redreaper666 - 06.07.2013

As i said i want to keep this not (complicated) as it is just for testing other filterscripts on an Testing Ground GM.
And also i dont like using plugins that other people did except of streamer plugins.

Changed:

Код:
if(sscanf(params, "s", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/reloadfs <fsname>");
Код:
if(sscanf(params, "s[30]", fsname)) return SendClientMessage(playerid, -1, "{F81414}COMMAND: {FFFFFF}/reloadfs <fsname>");
Thanks for info


Re: Easy Load/Unload/Reload FS ingame - Mckarlis - 06.07.2013

Nice job.


Re: Easy Load/Unload/Reload FS ingame - John_Tylor - 26.07.2013

Great job +Rep


Re: Easy Load/Unload/Reload FS ingame - MuhsinunCool - 04.08.2015

I need help with this please i don't understand how to compile the .pwn file to .amx with pawno it says:
Код:
C:\MAHFOLDERBLAHBLAH\FilterScriptLoaderUnloaderReloader.pwn (4) : fatal error 100: cannot read from file: "zcmd"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
can u help me please? I copied the code then pasted it in a new text document then saved it as FilterScriptLoaderUnloaderReloader.pwn as all files then opened it in pawno then tried to compile it can someone tell me how to do this? Sorry im a noob at this


Re: Easy Load/Unload/Reload FS ingame - MrSwift - 04.08.2015

You don't have zcmd in your include folder i think. Be sure you have all needed includes for this.