How do i make a filterscript?
#1

So i have this code from a script i really like it and want to make it into a filterscript so i can run it on my server soooo i wana know how to do it


Heres the code




//----------------------------------------[New MoneyBags system]--------------------//
if(strcmp(cmd, "/makemoneybag", true) == 0 || strcmp(cmd, "/moneybag", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
return SendClientMessage(playerid, GREY, " You are not authorized to use this command.");
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SyntaxMessage(playerid, "/makemoneybag [amount]");
new amount = strval(tmp);
if(amount < 1) return SendClientMessage(playerid, WHITE, "cannot go below 1.");
new Float:X,Float:Y,Float:Z;
new location[MAX_ZONE_NAME];
GetPlayerPos(playerid,X,Y,Z);
CreateMoney(X, Y, Z, amount);
if(!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPosEx(playerid, X, Y-2, Z);
}
SendClientMessage(playerid, GREY1,"* Money bag created.");
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
format(string, sizeof(string), "WARNING: %s has created a money bag worth $%d in %s (%0.2f, %0.2f, %0.2f).", sendername, amount, location, X, Y, Z);
ABroadCast(RED, string, 1);
format(string, sizeof(string), "{FF6347}%s has hidden a money bag in %s worth $%d!", sendername, location, amount);
SendClientMessageToAll(LIGHTRED, string);
return 1;
}
}
if(strcmp(cmd, "/deletebag", true) == 0 || strcmp(cmd, "/deletemoneybag", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] <= 3)
{
return SendClientMessage(playerid, GREY, " You are not authorized to use this command.");
}
DeleteClosestBag(playerid);
return 1;
}
}
if(strcmp(cmd, "/deletebags", true) == 0 || strcmp(cmd, "/deletemoneybags", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] <= 99999)
{
return SendClientMessage(playerid, GREY, " You are not authorized to use this command.");
}
DeleteAllBags();
SendClientMessage(playerid, GREY2, "* Money bags destroyed.");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "WARNING: %s has destroyed all money bags.", sendername);
ABroadCast(RED, string, 1);
return 1;


Please help or teach and explain to me how to do it or just do it for me because im a complete noob xD
Reply
#2

Pls use code inside of it
Reply
#3

Open up Pawno.exe and click on new.

Do the same as you would for a normal script, but use OnFilterScriptInit & OnFilterScriptExit instead of OnGameMode*. Uncomment the top line to define it as a filterscript.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)