[FilterScript] Easy Load/Unload/Reload FS ingame
#1

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.
Reply
#2

Nice Good work.
Reply
#3

Awesome , Nice work ++++rep
Reply
#4

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

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>");
Reply
#6

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.
Reply
#7

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
Reply
#8

Nice job.
Reply
#9

Great job +Rep
Reply
#10

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
Reply
#11

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


Forum Jump:


Users browsing this thread: 2 Guest(s)