[Tool/Web/Other] Joke Filterscripts
#1

This thread is dedicated to joke filterscripts

Please feel free to post any silly scripts you might come up with.

Keep in mind a few things when creating scripts, only standard libraries and includes should be used that way anyone trying to compile can easily get anything they might need.

Here are some links to what I consider standard stuff and should be in any scripters toolbox.

YSI - http://ysi.tl/
ZCMD - https://sampforum.blast.hk/showthread.php?tid=91354
SQLite Improved - https://sampforum.blast.hk/showthread.php?tid=303682
Strlib - https://sampforum.blast.hk/showthread.php?tid=362764
sscanf2 plugin - https://sampforum.blast.hk/showthread.php?tid=120356
Streamer plugin - https://sampforum.blast.hk/showthread.php?tid=102865
RNPC - https://sampforum.blast.hk/showthread.php?tid=355849
FCNPC - https://sampforum.blast.hk/showthread.php?tid=428066 (Keep in mind this still has problems with Linux version, possibility of becoming unusable in the future)

In the spirit of Christmas I present the cheesy snow effect! Flashy and consuming over 250kb/sec bandwidth per second what a joke!

pawn Code:
// Cheesy snow effect
#include <a_samp>
#include <zcmd>

#define         MAX_SNOW_FLAKES         100 //snow on screen
#define         X_SIZE                  640
#define         Y_SIZE                  480

#define         SNOW_SPEED              30

new Text:SnowFlakes[MAX_SNOW_FLAKES];

new bool:SnowOn[MAX_PLAYERS];

enum FLAKEINFO
{
    Float:FallSpeed,
    Float:x,
    Float:y,
}

new FlakeData[MAX_SNOW_FLAKES][FLAKEINFO];


public OnFilterScriptInit()
{
    //randomize starting points for snowflakes
    for(new i = 0; i < MAX_SNOW_FLAKES; i++)
    {
        FlakeData[i][x] = float(random(X_SIZE));
        FlakeData[i][y] = float(random(Y_SIZE));
    }
   
    // Pre-create so we don't need to check if the textdraw has actually been created since it would only happen once
    for(new i = 0; i < MAX_SNOW_FLAKES; i++)
    {
        SnowFlakes[i] = TextDrawCreate(FlakeData[i][x], 0.000000, ".");

        FlakeData[i][FallSpeed] = floatdiv(random(250), 100) + 0.5;
    }

    // Start snowflake update timer
    SetTimer("SnowLoop", SNOW_SPEED, true);

    return 1;
}

// Make Sure we delete all snowflakes
public OnFilterScriptExit()
{
    for(new i = 0; i < MAX_SNOW_FLAKES; i++)
    {
        TextDrawDestroy(SnowFlakes[i]);
    }
    return 1;
}

// Snow is off by default
public OnPlayerConnect(playerid)
{
    SnowOn[playerid] = false;
    return 1;
}

// Toggle snow on/off
CMD:snow(playerid, arg[])
{
    if(SnowOn[playerid])
    {
        SnowOn[playerid] = false;
        SendClientMessage(playerid, -1, "Snow Off");
    }
    else
    {
        SnowOn[playerid] = true;
        SendClientMessage(playerid, -1, "Snow On");
    }
    return 1;
}

// Update Snowflake positions and show to players
forward SnowLoop();
public SnowLoop()
{
    for(new i = 0; i < MAX_SNOW_FLAKES; i++)
    {
        FlakeData[i][y] += FlakeData[i][FallSpeed];
        if(FlakeData[i][y] >= Y_SIZE)
        {
            FlakeData[i][y] = 0.0;
            FlakeData[i][FallSpeed] = floatdiv(random(250), 100) + 0.5;
        }
        TextDrawDestroy(SnowFlakes[i]);
        DrawFlake(i, FlakeData[i][x], FlakeData[i][y]);
    }

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(SnowOn[i])
        {
            for(new j = 0; j < MAX_SNOW_FLAKES; j++)
            {
                TextDrawShowForPlayer(i, SnowFlakes[j]);
            }
        }
    }
}

// Draw a snowflake
stock DrawFlake(index, Float:sx, Float:sy)
{
    SnowFlakes[index] = TextDrawCreate(sx, sy, ".");
    TextDrawBackgroundColor(SnowFlakes[index], 255);
    TextDrawFont(SnowFlakes[index], 1);
    TextDrawLetterSize(SnowFlakes[index], 0.900000, 3.500000);
    TextDrawColor(SnowFlakes[index], -1);
    TextDrawSetOutline(SnowFlakes[index], 0);
    TextDrawSetProportional(SnowFlakes[index], 1);
    TextDrawSetShadow(SnowFlakes[index], 0);
    TextDrawSetSelectable(SnowFlakes[index], 0);
}
Reply
#2

This is a older one I'm just re-posting here and will ask a moderator to lock or delete the old thread here. One more request if this could possibly be set as a sticky since I plan on making more goofy joke scripts in the future and would like to see other peoples

https://sampforum.blast.hk/showthread.php?tid=474856

Just a stupid idea I did for the hell of it. When a player dies flowers will spawn and rise out of the ground of their death spot in a few seconds.

pawn Code:
#include <a_samp>

#define         MAX_FLOWERS         50
#define         FLOWER_OBJECT       325
#define         RAISE_DELAY         3000
#define         CLEAR_TIME          5000

new Flowers[MAX_FLOWERS] = { -1, ... };


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Flower death by [uL]Pottus");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    for(new i = 0; i < MAX_FLOWERS; i++)
    {
        if(Flowers[i] != -1) DestroyObject(Flowers[i]);
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetTimerEx("RaiseFlowers", RAISE_DELAY, false, "fff", x, y, z);
    return 1;
}

forward RaiseFlowers(Float:x, Float:y, Float:z);
public RaiseFlowers(Float:x, Float:y, Float:z)
{
    for(new i = 0; i < MAX_FLOWERS; i++)
    {
        if(Flowers[i] == -1)
        {
            Flowers[i] = CreateObject(FLOWER_OBJECT, x, y, z-1.5, 0.0, 0.0, 0.0, 300.0);
            MoveObject(Flowers[i], x, y, z-1.0, 0.5);
            SetTimerEx("ClearFlowers", CLEAR_TIME, false, "i", i);
            return 1;
        }
    }
    return 0;
}

forward ClearFlowers(id);
public ClearFlowers(id)
{
    DestroyObject(Flowers[id]);
    Flowers[id] = -1;
    return 1;
}
Reply
#3

Is what I understood that we must publish any FS to joke?.
Reply
#4

Yes any joke filterscript.

Also, please only use standard libraries and includes such as YSI, or zcmd
Reply
#5

not bad .
Reply
#6

Nice FS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)