SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 06/07/2015, 10:37 AM   #1
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 252
Reputation: 27
Default Message3.inc (prevent chat spam and keep chat clean)

This include was created to help people keep their chat box on the server clean and only for chat. i have made all other messages that are not to do with players chatting to other players into textdraws so the chat is only for chat purposes, with the include you can send Usage, Error, Info, Adverts and Admin messages. Everyone has there own way they play so i added so each player can position their own messages to their own desire.


At the top of your code use #include <message3>

Features:
  • Creates an indiviual textdraw for cetian messages
  • prevents chat spam of unwanted messages

Requirements:
  • zcmd.inc // #include this into your gamemode before the Message2.inc (without this the include will not function).
  • sscanf2.inc // #include this into your gamemode before the Message2.inc (without this the include will not function).
  • foreach.inc // #include this into your gamemode before the Message2.inc (without this the include will not function).
  • sscanf.dll/.so // Dont forget to put this in your plugin folder and write on the line "plugins" on your server.cfg.

Message Styles:
Code:
MSG_STYLE_ERROR    1
MSG_STYLE_INFO     2
MSG_STYLE_USAGE    3
MSG_STYLE_ADVERT   4
MSG_STYLE_ADMIN    5
Functions:
Code:
SendServerMessage(playerid, msgstyle, const message[]);
CreateMessageTextDraw(playerid); // Place under OnPlayerConnect(playerid) Otherwise the textdraws will not show
DestroyMessageTextDraw(playerid); // Place Under OnPlayerDisconnect(playerid, reason) Otherwise the textdraws will not show

Commands:
  • /msgpos - Usage /msgpos [Custom X] [Custom Y].
  • /defaultmsg

Example:
Code:
CMD:goto(playerid, params[])
{
    new pID,Float:Pos[3], string[50];
    if(pInfo[playerid][Adminlvl] < 3) return SendServerMessage(playerid, MSG_STYLE_ERROR ,"You are not high enough admin level!");  // New Code!!
    if(sscanf(params, "u", pID)) return SendServerMessage(playerid, MSG_STYLE_USAGE,"Usage: /goto [ID]");  // New Code!!
    if(pID == IPI) return SendServerMessage(playerid, MSG_STYLE_ERROR,"Player is not connected!"); // New Code!!
    GetPlayerPos(pID,Pos[0],Pos[1],Pos[2]);
    SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); 
    SetPlayerInterior(playerid,GetPlayerInterior(pID));
    format(string,sizeof(string),"Admin %s has teleported to you",GetName(playerid));
    SendServerMessage(playerid, MSG_STYLE_INFO, str);  // New Code!!
    return 1;
}
MSG_STYLE_ADMIN Example
Code:
CMD:atalk(playerid, params[])
{
	new text[128];
	if(sscanf(params, "s[128]", text)) return SendServerMessage(playerid, MSG_STYLE_USAGE, "/atalk [text]");
	SendServerMessage(playerid, MSG_STYLE_ADMIN, text);
	return 1;
}

ScreenShot:






Please post your views on this include, the good, the bad and Suggestions are all welcomed.

Thanks for taking time to look at my work!

Last edited by Jakwob; 30/07/2015 at 06:12 PM.
Jakwob is offline   Reply With Quote
Old 14/07/2015, 04:39 PM   #2
simo0000
Huge Clucker
 
simo0000's Avatar
 
Join Date: Nov 2013
Posts: 247
Reputation: 12
Default Re: Message3.inc (prevent chat spam and keep chat clean)

great work +rep
__________________


My filterscripts

S-AFK
S-Giftbox dynamic giftbox system

If I've helped you, Don't forget to +REP me
simo0000 is offline   Reply With Quote
Old 14/07/2015, 09:05 PM   #3
iTakelot
Gangsta
 
Join Date: Jun 2015
Location: Brasil
Posts: 680
Reputation: 30
Default Re: Message3.inc (prevent chat spam and keep chat clean)

muito bom parabens.
__________________
n\a
iTakelot is offline   Reply With Quote
Old 14/07/2015, 10:16 PM   #4
ExTaZZ69
Big Clucker
 
ExTaZZ69's Avatar
 
Join Date: Mar 2015
Location: Romania
Posts: 148
Reputation: 23
Default Re: Message3.inc (prevent chat spam and keep chat clean)

it looks great. Good job! Simple but very usefull include.
ExTaZZ69 is online now   Reply With Quote
Old 14/07/2015, 10:33 PM   #5
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Re: Message3.inc (prevent chat spam and keep chat clean)

Again, as suggested in the others, you should add an optional pre-define position. So if a user defines MSG_POS, you will use their custom position instead of your default.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 15/07/2015, 08:17 AM   #6
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 252
Reputation: 27
Default Re: Message3.inc (prevent chat spam and keep chat clean)

Thanks for the comments guys

Quote:
Originally Posted by Crayder View Post
Again, as suggested in the others, you should add an optional pre-define position. So if a user defines MSG_POS, you will use their custom position instead of your default.
As it states in the topic there is a command so every player can have there own custom position or they can have the default position. I did it that way as everyone has there own views.
Jakwob is offline   Reply With Quote
Old 15/07/2015, 11:04 AM   #7
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Re: Message3.inc (prevent chat spam and keep chat clean)

Quote:
Originally Posted by Jakwob View Post
As it states in the topic there is a command so every player can have there own custom position or they can have the default position. I did it that way as everyone has there own views.
I know that. What I'm saying is, the server owner may want it to have a different default position. What if a server owner already has textdraws there? It wouldn't be up to the players then, would it?
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 15/07/2015, 03:57 PM   #8
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 252
Reputation: 27
Default Re: Message3.inc (prevent chat spam and keep chat clean)

Quote:
Originally Posted by Crayder View Post
I know that. What I'm saying is, the server owner may want it to have a different default position. What if a server owner already has textdraws there? It wouldn't be up to the players then, would it?
Thanks for the suggestion and I will add it right way and will be in the next update
Jakwob is offline   Reply With Quote
Old 15/07/2015, 04:34 PM   #9
AchievementMaster360
Huge Clucker
 
AchievementMaster360's Avatar
 
Join Date: Apr 2012
Location: New York, United States
Posts: 237
Reputation: 24
Post Re: Message3.inc (prevent chat spam and keep chat clean)

Nice job and also this is a pretty unique idea.
AchievementMaster360 is offline   Reply With Quote
Old 15/07/2015, 04:43 PM   #10
SickAttack
Godfather
 
Join Date: Dec 2013
Posts: 5,140
Reputation: 751
Default Re: Message3.inc (prevent chat spam and keep chat clean)

Add a pastebin link.
SickAttack is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anti Chat spam only (rep+) haridz Scripting Help 2 01/05/2015 10:00 AM
PlayAudioStreamForPlayer chat spam sirvanec Scripting Help 14 25/12/2014 03:32 PM
anti spam chat Paulll Romānă/Romanian 0 09/12/2012 07:37 PM
NPC bot spam chat OnPlayerText [EnErGyS]KING Scripting Help 10 10/08/2012 11:07 AM
StopAudioStreamForPlayer - CHAT SPAM - TEXT DRAW aNdReSk Scripting Help 2 06/04/2012 01:33 AM


All times are GMT. The time now is 11:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.