Advertisement
Guest User

X Box

a guest
Aug 28th, 2012
757
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.71 KB | None | 0 0
  1. //===========================
  2. //      *      *             |
  3. //       *    *              |
  4. //        *  *               |
  5. //         **  Box           |
  6. //        *  *               |
  7. //       *    *              |
  8. //      *      *             |
  9. //     |
  10. // Dont NOT Re-Upload it     |
  11. // Do not Remove the credits |
  12. // By XtremeR                |
  13. //===========================
  14.  
  15.  
  16. #include <a_samp>
  17. #include <zcmd>
  18.  
  19. //new textdraws
  20. new Text:XMsg[15];
  21. new XMsgStr[15][128];
  22. new Text:Textdraw0;
  23.  
  24. main()
  25. {
  26.     print("\n--------------------------------------------------------");
  27.     print(" XBox By XtremeR");
  28.     print("--------------------------------------------------------\n");
  29. }
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     print("-----------------------------");
  34.     print("X - Box By XtremeR Loaded !");
  35.     print("-----------------------------");
  36.    
  37.     for(new line; line<15; line++)
  38.     {
  39.         format(XMsgStr[line], 128, " ");
  40.     }
  41.     XMsg[1] = TextDrawCreate(365, 342+38, XMsgStr[1]);
  42.     XMsg[2] = TextDrawCreate(365, 349+38, XMsgStr[2]);
  43.     XMsg[3] = TextDrawCreate(365, 356+38, XMsgStr[3]);
  44.     XMsg[4] = TextDrawCreate(365, 363+38, XMsgStr[4]);
  45.     XMsg[5] = TextDrawCreate(365, 370+38, XMsgStr[5]);
  46.     XMsg[6] = TextDrawCreate(365, 377+38, XMsgStr[6]);
  47.     XMsg[7] = TextDrawCreate(365, 384+38, XMsgStr[7]);
  48.     XMsg[8] = TextDrawCreate(365, 391+38, XMsgStr[8]);
  49.     XMsg[9] = TextDrawCreate(365, 398+38, XMsgStr[9]);
  50.     for(new line; line<15; line++)
  51.     {
  52.         TextDrawLetterSize(XMsg[line], 0.40, 0.90);
  53.         TextDrawSetShadow(XMsg[line], 0);
  54.         TextDrawAlignment(XMsg[line], 1);
  55.         TextDrawFont(XMsg[line], 1);
  56.         TextDrawShowForAll(XMsg[line]);
  57.     }
  58.     for(new line; line<15; line++)
  59.     {
  60.         TextDrawLetterSize(XMsg[line], 0.28, 0.83);
  61.         TextDrawSetShadow(XMsg[line], 0);
  62.         TextDrawAlignment(XMsg[line], 1);
  63.         TextDrawTextSize(XMsg[line], 640, 480);
  64.         TextDrawBoxColor(XMsg[line], 0x000000FF);
  65.         TextDrawFont(XMsg[line], 1);
  66.         TextDrawSetOutline(XMsg[line], 1);
  67.         TextDrawShowForAll(XMsg[line]);
  68.     }
  69.     for(new i; i < MAX_PLAYERS; i ++)
  70.     {
  71.         if(IsPlayerConnected(i))
  72.         {
  73.             TextDrawShowForPlayer(i, Textdraw0);
  74.         }
  75.     }
  76.     Textdraw0 = TextDrawCreate(642.000000, 373.000000, "               ");
  77.     TextDrawBackgroundColor(Textdraw0, 255);
  78.     TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
  79.     TextDrawSetOutline(Textdraw0, 0);
  80.     TextDrawSetProportional(Textdraw0, 1);
  81.     TextDrawSetShadow(Textdraw0, 1);
  82.     TextDrawUseBox(Textdraw0, 1);
  83.     TextDrawBoxColor(Textdraw0, 0x00000033);
  84.     TextDrawTextSize(Textdraw0, 357.000000, 0.000000);
  85.     return 1;
  86. }
  87.  
  88. public OnFilterScriptExit()
  89. {
  90.     TextDrawHideForAll(Textdraw0);
  91.     TextDrawDestroy(Textdraw0);
  92.    
  93.     for(new line; line<15; line++)
  94.     {
  95.         TextDrawDestroy(XMsg[line]);
  96.     }
  97.     return 1;
  98. }
  99.  
  100.  
  101. public OnPlayerConnect(playerid)
  102. {
  103.     TextDrawShowForPlayer(playerid, Textdraw0);
  104.     for(new line; line<15; line++)
  105.     {
  106.         TextDrawShowForPlayer(playerid, XMsg[line]);
  107.     }
  108.    
  109.     //sending Box a MSG when some one joins
  110.     new string[64], pName[MAX_PLAYER_NAME];
  111.     GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  112.     format(string,sizeof string,"~g~%s has joined the server.",pName);
  113.     SendXMessage(playerid, string);
  114.     return 1;
  115. }
  116.  
  117. public OnPlayerDisconnect(playerid, reason)
  118. {
  119.  
  120.     //sending Box a MSG When someone Leaves
  121.     new string1[64], name[MAX_PLAYER_NAME];
  122.     GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  123.     switch(reason)
  124.     {
  125.         case 0: format(string1,sizeof string1,"~r~%s has left the server. [Timed out]",name);//timeout
  126.         case 1: format(string1,sizeof string1,"~r~%s has left the server. [Leaving]",name);//leaving
  127.         case 2: format(string1,sizeof string1,"~r~%s has left the server. [Kicked/Banned]",name);//kicked or banned
  128.     }
  129.     SendXMessage(playerid, string1);
  130.     return 1;
  131. }
  132.  
  133. CMD:box(playerid,params[]) {
  134.     #pragma unused params
  135.     IsPlayerAdmin(playerid);
  136.     if(isnull(params)) return SendClientMessage(playerid,0xBD34DAFF,"Current Usage: /boxchat [text]");
  137.     SendClientMessage(playerid,0x20B2AAFF,"Message Sended!");
  138.     new string[128],name[24];
  139.     GetPlayerName(playerid,name,sizeof(name));
  140.     format(string,sizeof(string),"Admin %s[ID:%i]: %s",name,playerid,params);
  141.     SendXMessage(playerid,string);
  142.     return 1;
  143. }
  144. CMD:abox(playerid,params[]) {
  145.     #pragma unused params
  146.     IsPlayerAdmin(playerid);
  147.     if(isnull(params)) return SendClientMessage(playerid,0xBD34DAFF,"Current Usage: /boxchat [text]");
  148.     SendClientMessage(playerid,0x20B2AAFF,"Message Sended!");
  149.     new string[128],name[24];
  150.     GetPlayerName(playerid,name,sizeof(name));
  151.     format(string,sizeof(string),"%s",params);
  152.     SendXMessage(playerid,string);
  153.     return 1;
  154. }
  155. CMD:clearbox(playerid,params[]) {
  156.     #pragma unused params
  157.     IsPlayerAdmin(playerid);
  158.     SendXMessage(playerid," ");
  159.     SendXMessage(playerid," ");
  160.     SendXMessage(playerid," ");
  161.     SendXMessage(playerid," ");
  162.     SendXMessage(playerid," ");
  163.     SendXMessage(playerid," ");
  164.     SendXMessage(playerid," ");
  165.     SendXMessage(playerid," ");
  166.     SendXMessage(playerid," ");
  167.     return 1;
  168. }
  169. stock SendXMessage(playerid, const text[])
  170. {
  171.     for(new line; line < 15; line++)
  172.     {
  173.         TextDrawShowForPlayer(playerid, XMsg[line]);//show the lines
  174.     }
  175.     for(new line; line < 15; line++)
  176.     {
  177.         TextDrawHideForAll(XMsg[line]);//hide the line
  178.         if(line < 14)
  179.         {
  180.             XMsgStr[line] = XMsgStr[line+1];//Message going up ^
  181.             TextDrawSetString(XMsg[line], XMsgStr[line]);
  182.         }
  183.     }
  184.     format(XMsgStr[9], 128, "%s",text);//Message !
  185.     TextDrawSetString(XMsg[9], XMsgStr[9]);//Start fron Line 9
  186.     for(new line; line < 15; line++) // goes up
  187.     {
  188.         TextDrawShowForAll(XMsg[line]);//TextDraw show for player
  189.     }
  190.     return 1;
  191. }
  192. //ALL BY XTREMER!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement