SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/06/2015, 11:18 AM   #1
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 250
Reputation: 27
Post Message2.inc (Removes unwanted spam from chat!)

Hey this is my first include, im sorry if anyone thinks this is useless, but i had the idea to prevent the chat in game being spammed by unwanted messages, and usage messages so i made them as a textdraw to show near the map and disappear after 5 seconds.

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

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).
  • 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
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;
}

Download:
Message.inc (solidfiles)
Message.inc (pastebin)

Message2.inc (solidfiles)
Message2.inc (pastebin)

ChangeLog 20/06/2015
  • Rewrote code to make it more user friendly.
  • Removed textdraws that was not needed.
  • Fixed timer bug.
  • Recolored some of the message titles.
  • Removed some timers.
  • Added Message Styles.
  • Removed SendErrorMessage.
  • Removed SendInfoMessage.
  • Removed SendUsageMessage.
  • Added new Function SendServerMessage.
  • Added checks to see if there is already a TD timer running.
  • New command to change the position of the textdraw so its in your ideal place.
  • New default position command to place your textdraw back to the default position.
  • Added checks to the X, Y positions.

ScreenShot:
http://i60.tinypic.com/o8ib60.jpg
http://i62.tinypic.com/2ug2ow9.jpg
http://i59.tinypic.com/2cp9e1e.jpg
http://i61.tinypic.com/ei9yxs.jpg
http://i57.tinypic.com/fz2emp.jpg
http://i62.tinypic.com/6sf0nk.jpg
http://i59.tinypic.com/34rzjax.jpg

Note: All comments are welcomed but please instead of posting bad comments, please tell me how i can improve the preformance.

Thanks for taking time to look at my work!

Last edited by Jakwob; 20/06/2015 at 02:47 PM. Reason: Include Update
Jakwob is offline   Reply With Quote
Old 16/06/2015, 02:37 PM   #2
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 875
Reputation: 261
Default Re: Message

Can you add a pastebin link? or create an account in github?

"Server not found"

EDIT:
Thanks

Good
Handy Include for Lazy ones and newbies

Last edited by Yashas; 16/06/2015 at 03:41 PM.
Yashas is offline   Reply With Quote
Old 16/06/2015, 02:40 PM   #3
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 250
Reputation: 27
Default Re: Message

Pastebin like has been added into the main topic. sorry for the inconvenience.
Jakwob is offline   Reply With Quote
Old 16/06/2015, 02:41 PM   #4
Alex Magaña
High-roller
 
Alex Magaña's Avatar
 
Join Date: Oct 2012
Location: Greece
Posts: 2,393
Reputation: 191
Default Re: Message

Simple.! good job ! looks interesting thought.!
__________________

Discord: #lsprison
Server: 94.68.237.141:6969

Alex Magaña is offline   Reply With Quote
Old 16/06/2015, 02:42 PM   #5
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 250
Reputation: 27
Default Re: Message

Quote:
Originally Posted by Alex Magaña View Post
Simple.! good job ! looks interesting thought.!
Thanks
Jakwob is offline   Reply With Quote
Old 16/06/2015, 03:19 PM   #6
Kapersky™
Gangsta
 
Kapersky™'s Avatar
 
Join Date: Jul 2014
Location: !ncredible India.
Posts: 760
Reputation: 334
Default Re: Message

Simple but nice. Appreciated. Thanks for contributing something to community, thanks!
__________________
CS undergraduate, IITGuwahati. | INPhO and INChO qualified | KVPY Scholar (SA AIR 102) | NTSE Scholar | JEE Advanced AIR: 582 | Finalist in Technothlon |

Nothing is gifted, whatever is achieved is only through dedication and hard work.
Kapersky™ is offline   Reply With Quote
Old 16/06/2015, 03:22 PM   #7
[ND]xXZeusXx.
High-roller
 
[ND]xXZeusXx.'s Avatar
 
Join Date: Jun 2014
Location: Psycholand
Posts: 1,393
Reputation: 96
Default Re: Message

Thats really nice mate!

I appreciate your took off your time to release something for all of us.


+rep for you
__________________
Quote:
Originally Posted by AndySedeyn View Post
You should add that to your signature.
Quote:
Originally Posted by KevinExec View Post
Prolly he has put a .bat to control your computer abd upload something to your network. if u have something bought like vps or website etc. he can hsck in it as admin if this is true
Quote:
Originally Posted by [Twixx] View Post
rape and std is very serious business
Quote:
Originally Posted by JakeXxX View Post
You want something funny?
Go in Pakistani Roleplay Server and speak with the Admins.
Quote:
Originally Posted by Mr.Tony View Post
Man, i don't really know but i read at Yahoo answers and Quora,that there few idian guys who met up girls online rally hot one, and after a while they started paying them when ever they ask for money..because the hot girls have job and gets paid well they pay their boy friend because he's jobless..and she stick to him to the end.
Quote:
Originally Posted by X337 View Post
Sex before marriage is haram
[ND]xXZeusXx. is offline   Reply With Quote
Old 16/06/2015, 03:31 PM   #8
[RO]Five
Big Clucker
 
[RO]Five's Avatar
 
Join Date: May 2012
Location: Romania, Piatra Neamt
Posts: 113
Reputation: 9
Default Re: Message

is like GameTextForPlayer, buy little small thanks
__________________
...
[RO]Five is offline   Reply With Quote
Old 16/06/2015, 03:34 PM   #9
Jakwob
Huge Clucker
 
Jakwob's Avatar
 
Join Date: Jan 2014
Location: United Kingdom
Posts: 250
Reputation: 27
Default Re: Message

Quote:
Originally Posted by Kapersky™ View Post
Simple but nice. Appreciated. Thanks for contributing something to community, thanks!
Quote:
Originally Posted by [ND]xXZeusXx. View Post
Thats really nice mate!

I appreciate your took off your time to release something for all of us.


+rep for you
Thanks i appreciate the nice comments you guys. and thanks for the rep, if you want more of my work visit my blogger link in my signature. Thanks again guys.

[QUOTE]is like GameTextForPlayer, buy little small thanks[QUOTE]
No this is all textdraws. Thanks.
Jakwob is offline   Reply With Quote
Old 16/06/2015, 04:03 PM   #10
Stanford
High-roller
 
Stanford's Avatar
 
Join Date: Feb 2012
Posts: 1,041
Reputation: 84
Default Re: Message

Wouldn't making it in the center is better?
Good job anyway
__________________
Y_Less: "That code compiles perfectly, but I can tell you now it won't make me a cup of tea."

Y_Less: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."
Stanford 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
Random Message fast message bigboy81 Scripting Help 5 24/01/2015 07:13 PM
[FilterScript] Server Message [SERVER TIPS, SERVER MESSAGE OF THE DAY] - Simple, basic but editable! roar Filterscripts 10 28/02/2013 02:19 PM
Send to admin other message and to player other message lonako45 Scripting Help 10 24/04/2012 12:35 PM
Need help changing the IRC message but not the In-Game message. OleKristian95 Scripting Help 3 07/04/2012 02:20 PM
[FilterScript] [FS]Welcome Message Devil001 Filterscripts 6 04/11/2010 08:11 PM


All times are GMT. The time now is 04:45 AM.


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