AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Killer Memes MOTD (https://forums.alliedmods.net/showthread.php?t=343626)

Jhob94 08-14-2023 08:35

Killer Memes MOTD
 
3 Attachment(s)
Killer Memes MOTD
- v0.0.1, released at : 14/08/2023


https://media.tenor.com/OdgYlp7oUX0AAAAC/woah-whoa.gif


Information
  • Display a MOTD when someone kills you
  • The GIF you see is the GIF your killer selected
  • Support sounds
  • GIF link must not have more than 255 characters
  • GIFs are saved by nVault
  • say /memes to open Memes Menu

Click here to watch a trial Video of this plugin


Credits
ufame - HTML code


memes.ini example
Code:

//"Name on Menu & MOTD Title" https://link_of_image.com/yourgif.gif sound/blah/blah.mp3 OR NOSOUND
"Wow" https://media.tenor.com/OdgYlp7oUX0AAAAC/woah-whoa.gif NOSOUND
"Hasbulla" https://media.tenor.com/OLH-sBYRUDYAAAAC/hasbulla-gaming.gif NOSOUND
"Holding Smile" https://i.makeagif.com/media/3-31-2017/825v2j.gif NOSOUND
"Kid Crying" https://i.makeagif.com/media/8-14-2023/cBrZxC.gif sound/memes/kid_crying.mp3
"Nice" https://i.makeagif.com/media/8-14-2023/_bu77A.gif sound/memes/nice.mp3
"OHHHHH" https://i.makeagif.com/media/8-14-2023/MV9xQw.gif sound/memes/ohhhhhh.mp3
"Flute John Cena" https://i.makeagif.com/media/8-14-2023/4FJMYL.gif sound/memes/flute_john_cena.mp3


Jhob94 08-14-2023 08:50

Re: Killer Memes
 
NOTES
Inside the zip file you have the GIF files. I am not sure for how long the GIFs will be online on those websites so you can add it to your own website.

If some link goes offline, please let me know so i can get a new link.

Also feel free to make your own memes and post them here! :up:

bigdaddy424 08-16-2023 20:02

Re: Killer Memes MOTD
 
how about having two options always are pinned at top
one for selecting my preferred and the other random

Jhob94 08-17-2023 04:20

Re: Killer Memes MOTD
 
That’s a good suggestion. Will do it tomorrow.

mlibre 08-17-2023 09:15

Re: Killer Memes MOTD
 
pretty rukia

Code:
set_task(CMD_MSG_DELAY, "Task__Message", TASK_ID, _, _, "b")
PHP Code:

set_task(CMD_MSG_DELAY"Task__Message"TASK_ID, .flags="b"

&
Code:
while(!feof(fop))
PHP Code:

while(fgets(fopszDatascharsmax(szDatas)) 


Jhob94 08-17-2023 09:55

Re: Killer Memes MOTD
 
Quote:

Originally Posted by mlibre (Post 2808756)
pretty rukia

Code:
set_task(CMD_MSG_DELAY, "Task__Message", TASK_ID, _, _, "b")
PHP Code:

set_task(CMD_MSG_DELAY"Task__Message"TASK_ID, .flags="b"

&
Code:
while(!feof(fop))
PHP Code:

while(fgets(fopszDatascharsmax(szDatas)) 


On set_task it is fine as it is. That’s not more efficient, maybe more readable, depending on who’s reading. That’s just a style, if you like it sure, but it’s pointless.

On file this is the proper way, feop is faster and cheaper. It compensates the null result you’ll get from fgets. Unless you have a really big file feop is the right choice. Anyway this is not a big deal, won’t have any impact.

mlibre 08-17-2023 10:30

Re: Killer Memes MOTD
 
clear, the set_task is more readable, it's optional. now in feof it was corrected in amxmodx since it was used incorrectly, I think it applies to everything.

Jhob94 08-17-2023 16:45

Re: Killer Memes MOTD
 
You were right, on my old rusty memory it was built different. Just checked and it's unnecessary to use feof. Yet using it causes no harm, it will just double check if the file has ended.
I will correct it on the next version.

Code:

static cell AMX_NATIVE_CALL amx_fgets(AMX *amx, cell *params)
{
        FileObject* fp = reinterpret_cast<FileObject*>(params[1]);

        if (!fp)
        {
                return 0;
        }

        static char buffer[4096];
        buffer[0] = '\0';

        fp->ReadLine(buffer, sizeof(buffer) - 1);

        return set_amxstring_utf8(amx, params[2], buffer, strlen(buffer), params[3]);
}

static cell AMX_NATIVE_CALL amx_feof(AMX *amx, cell *params)
{
        FileObject* fp = reinterpret_cast<FileObject*>(params[1]);

        if (fp)
        {
                return fp->EndOfFile();
        }

        return 1;
}


Jhob94 08-18-2023 05:28

Re: Killer Memes MOTD
 
New version 0.0.2
- Added Random GIF option as first choice
- Added a new GIF to the files

https://i.makeagif.com/media/8-18-2023/yY43G3.gif

mlibre 08-18-2023 11:07

Re: Killer Memes MOTD
 
nice why not use the constant already defined would replace SERVERMAXPLAYERS :attack:


All times are GMT -4. The time now is 17:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.