SA-MP Forums Archive
[Include] Message - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Message (/showthread.php?tid=578065)



Message2.inc (Removes unwanted spam from chat!) - Jakwob - 16.06.2015

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: Requirements:
Message Styles:
Код:
MSG_STYLE_ERROR    1
MSG_STYLE_INFO     2
MSG_STYLE_USAGE    3
Functions:
pawn Код:
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:
Example:
pawn Код:
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 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!


Re: Message - Yashas - 16.06.2015

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


Re: Message - Jakwob - 16.06.2015

Pastebin like has been added into the main topic. sorry for the inconvenience.


Re: Message - Alex Magaсa - 16.06.2015

Simple.! good job ! looks interesting thought.!


Re: Message - Jakwob - 16.06.2015

Quote:
Originally Posted by Alex Magaсa
Посмотреть сообщение
Simple.! good job ! looks interesting thought.!
Thanks


Re: Message - Kapersky™ - 16.06.2015

Simple but nice. Appreciated. Thanks for contributing something to community, thanks!


Re: Message - Ritzy2K - 16.06.2015

Thats really nice mate!

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


+rep for you


Re: Message - [RO]Five - 16.06.2015

is like GameTextForPlayer, buy little small thanks


Re: Message - Jakwob - 16.06.2015

Quote:
Originally Posted by Kapersky™
Посмотреть сообщение
Simple but nice. Appreciated. Thanks for contributing something to community, thanks!
Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
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.


Re: Message - Stanford - 16.06.2015

Wouldn't making it in the center is better?
Good job anyway