[FilterScript] [Add-On] Chuck Norris Facts!
#1

okay so I'm really (and I mean REALLY) bored today. so I made something new called chuck jokes. when you type the command it will say a random chuck joke from your list to EVERYONE in the server in bright red (:!

Please don't flame me as I know this is not really an FS.
Credits also go to Cuerv0_Negro for giving me the idea out of his source.

EDIT: now uses zcmd, go have fun (:

Код:
#include <a_samp>
#include <zcmd>

#define RED 0xE60000FF
#define COLOR_GREEN 0x9EC73DAA

new RandomMessages[][] =
{
    "Chuck Norris eats beer and drinks bear for breakfast.",
    "Chuck Norris can kill two stones with one bird."
    // Add more lines here :D
};

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" 	Chuck Norris Jokes Loaded...       ");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

    new string[63];
    new sendername[MAX_PLAYER_NAME];
    COMMAND:chucknorris(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(!IsPlayerAdmin(playerid))
            {
                SendClientMessage(playerid, COLOR_GREEN, "You are not authorized to use that command.");
                return 1;
            }
           	new randMSG = random(sizeof(RandomMessages));
    		SendClientMessageToAll(RED, RandomMessages[randMSG]);
			format(string, sizeof(string), "[ADMIN]: %s has Announced Chuck's Fact!", sendername);
		}
		return 1;
	}
	return 0;
ZCMD can be found here(can also be used for other commands since I think it's pretty fast):

http://forum.sa-mp.com/showthread.ph...highlight=zcmd
Reply
#2

Lol'z, cool idea, gotta love chuck.
Reply
#3

Lol its too simple
Reply
#4

Failscript.
The noobs'll post errors because strtok isnot included, I see. And,
Quote:

new string[512 char];

Je*us c*rist.
pawn Код:
new string[63];
And you have at the format at the end: "!.". Why the dot? After an exclamation mark, you must not add a dot.
And use [ pawn ]{PAWN_CODE}[ /pawn ] instead of [ code ]{PAWN_CODE}[ /code ]
Reply
#5

- Unnecessary cell sizes (512)
- Unnecessary use of IsPlayerConnected function (players can't type commands if not connected)
- Use of strtok + strcmp method. ZCMD is much faster and efficient
- You format a string at the end for no reason
Reply
#6

They say the boogey man looks under his bed for Chuck Norris. Chuck Norris looks under his bed for Fedor.
Reply
#7

Lol nice idea, guys don't flame him lol, he told this is not a fs.
Reply
#8

Quote:
Originally Posted by Master_Gangster
Посмотреть сообщение
Код:
    new string[512 char];
}
LMAO, why do you use a 512 char array there? That is 128 cell-long, so why don't you use string[128]?
Reply
#9

Very nice idea XD!
Reply
#10

chuck facts. ****** for a list.
theres much of them
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)