Advertisement
Guest User

xAdminChat

a guest
Sep 12th, 2012
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.66 KB | None | 0 0
  1. //===========================
  2. //      *      *             |
  3. //       *    *              |
  4. //        *  *               |
  5. //         **  AdminChat     |
  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. #include <sscanf>
  19.  
  20. //new textdraws
  21. new Text:XMsg[15];
  22. new XMsgStr[15][128];
  23.  
  24. main()
  25. {
  26.     print("\n--------------------------------------------------------");
  27.     print(" XAdmin Chat By XtremeR");
  28.     print("--------------------------------------------------------\n");
  29. }
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     print("-----------------------------");
  34.     print("X - AdminChat By XtremeR Loaded !");
  35.     print("-----------------------------");
  36.     for(new line; line<15; line++)
  37.     {
  38.         format(XMsgStr[line], 128, " ");
  39.     }
  40.     XMsg[2] = TextDrawCreate(365, 374.000000, XMsgStr[2]);
  41.     XMsg[3] = TextDrawCreate(365, 383.000000, XMsgStr[3]);
  42.     XMsg[4] = TextDrawCreate(365, 392.000000, XMsgStr[4]);
  43.     XMsg[5] = TextDrawCreate(365, 410.000000, XMsgStr[5]);
  44.     XMsg[6] = TextDrawCreate(365, 410.000000, XMsgStr[6]);
  45.     XMsg[7] = TextDrawCreate(365, 419.000000, XMsgStr[7]);
  46.     XMsg[8] = TextDrawCreate(365, 428.000000, XMsgStr[8]);
  47.     XMsg[9] = TextDrawCreate(365, 436.000000, XMsgStr[9]);
  48.     for(new line; line<15; line++)
  49.     {
  50.         TextDrawLetterSize(XMsg[line], 0.230000, 1.100000);
  51.         TextDrawSetShadow(XMsg[line], 0);
  52.         TextDrawTextSize(XMsg[line], 640, 480);
  53.         TextDrawBoxColor(XMsg[line], 0x000000FF);
  54.         TextDrawSetProportional(XMsg[line], 1);
  55.         TextDrawFont(XMsg[line], 1);
  56.         TextDrawSetOutline(XMsg[line], 1);
  57.         TextDrawShowForAll(XMsg[line]);
  58.     }
  59.     for(new line; line<15; line++)
  60.     {
  61.         TextDrawLetterSize(XMsg[line], 0.230000, 1.100000);
  62.         TextDrawSetShadow(XMsg[line], 0);
  63.         TextDrawTextSize(XMsg[line], 640, 480);
  64.         TextDrawBoxColor(XMsg[line], 0x000000FF);
  65.         TextDrawSetProportional(XMsg[line], 1);
  66.         TextDrawFont(XMsg[line], 1);
  67.         TextDrawSetOutline(XMsg[line], 1);
  68.         TextDrawShowForAll(XMsg[line]);
  69.     }
  70.     return 1;
  71. }
  72.  
  73. public OnFilterScriptExit()
  74. {
  75.    
  76.     for(new line; line<15; line++)
  77.     {
  78.         TextDrawDestroy(XMsg[line]);
  79.     }
  80.     return 1;
  81. }
  82.  
  83.  
  84. public OnPlayerConnect(playerid)
  85. {
  86.     for(new line; line<15; line++)
  87.     {
  88.         TextDrawShowForPlayer(playerid, XMsg[line]);
  89.     }
  90.     return 1;
  91. }
  92.  
  93. public OnPlayerDisconnect(playerid, reason)
  94. {
  95.     return 1;
  96. }
  97. CMD:report(playerid,params[])
  98. {
  99.     new string[128],id,reason[128];
  100.     new reportername[MAX_PLAYER_NAME],hackername[MAX_PLAYER_NAME];
  101.     GetPlayerName(playerid,reportername,sizeof(string));
  102.     GetPlayerName(id,hackername,sizeof(string));
  103.     if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,-1,"ERROR: /report <Playername/id> <Reason>");
  104.     else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "ERROR: Player is not connected!");
  105.     format(string,sizeof(string),"~r~REPORT: %s has reported %s ~y~<Reason: %s>",reportername,hackername,reason);
  106.     SendXMessage(playerid,string);
  107.     return 1;
  108. }
  109. CMD:a(playerid,params[]) {
  110.     #pragma unused params
  111.     IsPlayerAdmin(playerid);
  112.     if(isnull(params)) return SendClientMessage(playerid,0xBD34DAFF,"Current Usage: /a [text]");
  113.     SendClientMessage(playerid,0x20B2AAFF,"Message Sended!");
  114.     new string[128],name[24];
  115.     GetPlayerName(playerid,name,sizeof(name));
  116.     format(string,sizeof(string),"Admin %s: %s",name,params);
  117.     SendXMessage(playerid,string);
  118.     return 1;
  119. }
  120. CMD:clearadminchat(playerid,params[]) {
  121.     #pragma unused params
  122.     IsPlayerAdmin(playerid);
  123.     SendXMessage(playerid," ");
  124.     SendXMessage(playerid," ");
  125.     SendXMessage(playerid," ");
  126.     SendXMessage(playerid," ");
  127.     SendXMessage(playerid," ");
  128.     SendXMessage(playerid," ");
  129.     SendXMessage(playerid," ");
  130.     SendXMessage(playerid," ");
  131.     SendXMessage(playerid," ");
  132.     return 1;
  133. }
  134. stock SendXMessage(playerid, const text[])
  135. {
  136.     for(new line; line < 15; line++)
  137.     {
  138.         TextDrawShowForPlayer(playerid, XMsg[line]);//show the lines
  139.     }
  140.     for(new line; line < 15; line++)
  141.     {
  142.         TextDrawHideForAll(XMsg[line]);//hide the line
  143.         if(line < 14)
  144.         {
  145.             XMsgStr[line] = XMsgStr[line+1];//Message going up ^
  146.             TextDrawSetString(XMsg[line], XMsgStr[line]);
  147.         }
  148.     }
  149.     format(XMsgStr[9], 128, "%s",text);//Message !
  150.     TextDrawSetString(XMsg[9], XMsgStr[9]);//Start fron Line 9
  151.     for(new line; line < 15; line++) // goes up
  152.     {
  153.         TextDrawShowForAll(XMsg[line]);//TextDraw show for player
  154.     }
  155.     return 1;
  156. }
  157. //ALL BY XTREMER!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement