SA-MP Forums Archive
[FilterScript] [Add-On] Chuck Norris Facts! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [Add-On] Chuck Norris Facts! (/showthread.php?tid=236105)



[Add-On] Chuck Norris Facts! - Master_Gangster - 06.03.2011

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


Re: [Add-On] Chuck Norris Facts! - Stigg - 07.03.2011

Lol'z, cool idea, gotta love chuck.


Re: [Add-On] Chuck Norris Facts! - BASITJALIL - 07.03.2011

Lol its too simple


Re: [Add-On] Chuck Norris Facts! - Kwarde - 07.03.2011

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 ]


Re: [Add-On] Chuck Norris Facts! - Grim_ - 07.03.2011

- 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


Re: [Add-On] Chuck Norris Facts! - iMonk3y - 07.03.2011

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


Re: [Add-On] Chuck Norris Facts! - Davz*|*Criss - 07.03.2011

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


Re: [Add-On] Chuck Norris Facts! - MrDeath537 - 07.03.2011

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]?


Re: [Add-On] Chuck Norris Facts! - Sasino97 - 07.03.2011

Very nice idea XD!


Re: [Add-On] Chuck Norris Facts! - legodude - 07.03.2011

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