16.06.2015, 11:18
(
Последний раз редактировалось Jakwob; 20.06.2015 в 14:47.
Причина: Include Update
)
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:
Functions:
Commands:
Download:
Message.inc (solidfiles)
Message.inc (pastebin)
Message2.inc (solidfiles)
Message2.inc (pastebin)
ChangeLog 20/06/2015
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!
At the top of your code use #include <message>
Features:
- Creates an indiviual textdraw for cetian messages
- prevents chat spam of unwanted messages
- 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.
Код:
MSG_STYLE_ERROR 1 MSG_STYLE_INFO 2 MSG_STYLE_USAGE 3
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
- /msgpos - Usage /msgpos [Custom X] [Custom Y].
- /defaultmsg
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;
}
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.
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!