Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Copyright(c), Leingod - 2011
- ________________________________________________________________________________
- ## ##### ## ## # ##### ## ###
- ## ## ## ## # # # # # #
- ## #### ## # # # ## ### # # # #
- ## ## ## # ## ## # # # # #
- ###### ##### ## # # ##### ## ###
- Le TextDraw Message Box
- ---------------------------
- ________________________________________________________________________________
- FORUM SA:MP PROFILE: http://forum.sa-mp.com/member.php?u=120914
- Credits:
- -Leingod (Me) For make this.
- -Sandra18[NL] I get little code from him
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
- #include <a_samp>
- #include <zcmd>
- //new
- new Text:Message[15];
- new MessageStr[15][128];
- new Text:LeTextDraw;
- // DEFINES
- #define le_TD_version "ver.3.0"
- main()
- {
- print("\n--------------------------------------------------------");
- print(" Running FilterScript Leingod's TextDraw Message Box "#le_TD_version"");
- print("--------------------------------------------------------\n");
- }
- public OnFilterScriptInit()
- {
- for(new line; line<15; line++)
- {
- format(MessageStr[line], 128, " ");
- }
- Message[0] = TextDrawCreate(365, 300+38, MessageStr[0]);
- Message[1] = TextDrawCreate(365, 307+38, MessageStr[1]);
- Message[2] = TextDrawCreate(365, 314+38, MessageStr[2]);
- Message[3] = TextDrawCreate(365, 321+38, MessageStr[3]);
- Message[4] = TextDrawCreate(365, 328+38, MessageStr[4]);
- Message[5] = TextDrawCreate(365, 335+38, MessageStr[5]);
- Message[6] = TextDrawCreate(365, 342+38, MessageStr[6]);
- Message[7] = TextDrawCreate(365, 349+38, MessageStr[7]);
- Message[8] = TextDrawCreate(365, 356+38, MessageStr[8]);
- Message[9] = TextDrawCreate(365, 363+38, MessageStr[9]);
- Message[10] = TextDrawCreate(365, 370+38, MessageStr[10]);
- Message[11] = TextDrawCreate(365, 377+38, MessageStr[11]);
- Message[12] = TextDrawCreate(365, 384+38, MessageStr[12]);
- Message[13] = TextDrawCreate(365, 391+38, MessageStr[13]);
- Message[14] = TextDrawCreate(365, 398+38, MessageStr[14]);
- for(new line; line<15; line++)
- {
- TextDrawLetterSize(Message[line], 0.40, 0.90);
- TextDrawSetShadow(Message[line], 0);
- TextDrawAlignment(Message[line], 1);
- TextDrawFont(Message[line], 1);
- TextDrawShowForAll(Message[line]);
- }
- for(new line; line<15; line++)
- {
- TextDrawLetterSize(Message[line], 0.28, 0.83);
- TextDrawSetShadow(Message[line], 0);
- TextDrawAlignment(Message[line], 1);
- TextDrawTextSize(Message[line], 640, 480);
- TextDrawBoxColor(Message[line], 0x000000FF);
- TextDrawFont(Message[line], 1);
- TextDrawSetOutline(Message[line], 1);
- TextDrawShowForAll(Message[line]);
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new line; line<15; line++)
- {
- TextDrawDestroy(Message[line]);
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- LeTextDraw = TextDrawCreate(360.000000,335.000000,"- - -");
- TextDrawUseBox(LeTextDraw,1);
- TextDrawBoxColor(LeTextDraw,0x00000033);
- TextDrawTextSize(LeTextDraw,800.000000,300.000000);
- TextDrawAlignment(LeTextDraw,0);
- TextDrawBackgroundColor(LeTextDraw,0x00000000);
- TextDrawFont(LeTextDraw,1);
- TextDrawLetterSize(LeTextDraw,1.000000,14.100000);
- TextDrawColor(LeTextDraw,0x00000000);
- TextDrawSetOutline(LeTextDraw,1);
- TextDrawSetProportional(LeTextDraw,1);
- TextDrawShowForPlayer(playerid, Text:LeTextDraw);
- for(new line; line<15; line++)
- {
- TextDrawShowForPlayer(playerid, Message[line]);
- }
- //example
- new stringA[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(stringA,sizeof stringA,"%s has joined the server.",pName);
- SendLeMessage(playerid, stringA);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, Text:LeTextDraw);
- //example
- new stringB[64], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- switch(reason)
- {
- case 0: format(stringB,sizeof stringB,"%s has left the server. (Timed out)",name);
- case 1: format(stringB,sizeof stringB,"%s has left the server. (Leaving)",name);
- case 2: format(stringB,sizeof stringB,"%s has left the server. (Kicked/Banned)",name);
- }
- SendLeMessage(playerid, stringB);
- return 1;
- }
- //example
- CMD:kill(playerid, params[])
- {
- #pragma unused params
- new xName[MAX_PLAYER_NAME], stringC[128];
- GetPlayerName(playerid, xName, MAX_PLAYER_NAME);
- SetPlayerHealth(playerid, -1);
- format(stringC, sizeof(stringC), "~w~%s ~r~Has used command /kill.", xName);
- SendLeMessage(playerid, stringC);
- return 1;
- }
- //example
- CMD:help(playerid, params[])
- {
- #pragma unused params
- new xName[MAX_PLAYER_NAME], stringD[128];
- GetPlayerName(playerid, xName, MAX_PLAYER_NAME);
- format(stringD, sizeof(stringD), "%s Has typed command /help.", xName);
- SendLeMessage(playerid, stringD);
- return 1;
- }
- stock SendLeMessage(playerid, const text[])
- {
- for(new line; line < 15; line++)
- {
- TextDrawShowForPlayer(playerid, Message[line]);
- }
- for(new line; line < 15; line++)
- {
- TextDrawHideForAll(Message[line]);
- if(line < 14)
- {
- MessageStr[line] = MessageStr[line+1];
- TextDrawSetString(Message[line], MessageStr[line]);
- }
- }
- format(MessageStr[14], 128, "%s",text);
- TextDrawSetString(Message[14], MessageStr[14]);
- for(new line; line < 15; line++)
- {
- TextDrawShowForAll(Message[line]);
- }
- return 1;
- }
- // ©Leingod 2011 - All rights Reserved
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement