[FilterScript] /News Command [Snippet]
#1

What is it ?

Its a news command so players on the server can see news from players.
Why I posted it ?

I posted the snippet to help beginner scripters that are making Roleplay servers. (Got requests on my ******* channel)
How to Install

Just Paste the snippet into your script and your ready.


|| Snippet ||



COLOR DEFINES / NEEDED

Код:
#define COLOR_GREY        0xAFAFAFAA
#define COLOR_SANTORANGE  0xFF6C3BAA
#define COLOR_WHITE 	  0xFFFFFFAA

CODE IT SELF

Код:
CMD:news(playerid, params[])
{
	if(PInfo[playerid][pJob] == 1)
	{
	    new ManName[MAX_PLAYER_NAME];
	    new string[128];
		GetPlayerName(playerid, ManName, sizeof(ManName));
		if(isnull(params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "(USAGE): /news [message]");
		format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
		SendClientMessageToAll(COLOR_WHITE,string);
		format(string, sizeof(string), "SAN ANDREAS NEWS NETWORK UPDATE");
		SendClientMessageToAll(COLOR_SANTORANGE,string);
		format(string, sizeof(string), "%s: %s", ManName, params);
		SendClientMessageToAll(COLOR_GREY,string);
		format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
		SendClientMessageToAll(COLOR_WHITE,string);
	}
	return 1;
}
Reply
#2

Good , it will help beginers !!
Reply
#3

wtf is this, and you forgot the COLOR_LIGHTBLUE
Reply
#4

We don't have your enum, so it's kind of pointless to place it for noobs ..
Reply
#5

This line honestly made me laugh.
pawn Код:
format(string, sizeof(string), "-------------------------------------------------------------------------------------------------------------");
Why format a string with just characters? A little redundant don't you think? Plus SA-MP is only able to print strings less than 128 characters, so one news broadcaster will not be able to fit a whole story in one line, and it'll all just spam the chatbox with hyphens. (i.e Annoying).
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=281
Reply
#7

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
We don't have your enum, so it's kind of pointless to place it for noobs ..
yeah You Can True because if Noobs don't know to change it and Pointless Noobs can't use this filterscript
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)