Guest User

AFK sistema

a guest
Jan 26th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.54 KB | None | 0 0
  1. /* Sulietuvino; Ern'Update
  2.  
  3.     /* AFK System by Flaken Please keep this credit and do not remove anything or repost it on the internet.
  4.     You may edit and change the materials but do not not provide this material to others without any circumstances** */
  5.  
  6.  
  7.     #include <a_samp>
  8.     new Showing[MAX_PLAYERS];
  9.  
  10.     #define COLOR_GREY                 0xAFAFAFAA
  11.     #define COLOR_GREEN             0x33AA33AA
  12.     #define COLOR_RED                 0xFF0000AA
  13.     #define COLOR_YELLOW             0xFFFF00AA
  14.     #define COLOR_WHITE             0xFFFFFFAA
  15.     #define COLOR_BLUE                 0x0000BBAA
  16.     #define COLOR_LIGHTBLUE         0x33CCFFAA
  17.     #define COLOR_ORANGE             0xFF9900AA
  18.     #define COLOR_LIME                 0x10F441AA
  19.     #define COLOR_MAGENTA             0xFF00FFFF
  20.     #define COLOR_NAVY                 0x000080AA
  21.     #define COLOR_AQUA                 0xF0F8FFAA
  22.     #define COLOR_CRIMSON             0xDC143CAA
  23.     #define COLOR_FLBLUE             0x6495EDAA
  24.     #define COLOR_BISQUE             0xFFE4C4AA
  25.     #define COLOR_BLACK             0x000000AA
  26.     #define COLOR_CHARTREUSE         0x7FFF00AA
  27.     #define COLOR_BROWN             0XA52A2AAA
  28.     #define COLOR_CORAL             0xFF7F50AA
  29.     #define COLOR_GOLD                 0xB8860BAA
  30.     #define COLOR_GREENYELLOW         0xADFF2FAA
  31.     #define COLOR_INDIGO             0x4B00B0AA
  32.     #define COLOR_IVORY             0xFFFF82AA
  33.     #define COLOR_LAWNGREEN         0x7CFC00AA
  34.     #define COLOR_SEAGREEN             0x20B2AAAA
  35.     #define COLOR_LIMEGREEN         0x32CD32AA
  36.     #define COLOR_MIDNIGHTBLUE         0X191970AA
  37.     #define COLOR_MAROON             0x800000AA
  38.     #define COLOR_OLIVE             0x808000AA
  39.     #define COLOR_ORANGERED         0xFF4500AA
  40.     #define COLOR_PINK                 0xFFC0CBAA
  41.     #define COLOR_SPRINGGREEN         0x00FF7FAA
  42.     #define COLOR_TOMATO             0xFF6347AA
  43.     #define COLOR_YELLOWGREEN         0x9ACD32AA
  44.     #define COLOR_MEDIUMAQUA         0x83BFBFAA
  45.     #define COLOR_MEDIUMMAGENTA     0x8B008BAA
  46.     #define COL_EASY                   "{FFF1AF}"
  47.     #define COL_WHITE                  "{FFFFFF}"
  48.     #define COL_BLACK                  "{0E0101}"
  49.     #define COL_GREY                   "{C3C3C3}"
  50.     #define COL_GREEN                  "{6EF83C}"
  51.     #define COL_RED                    "{F81414}"
  52.     #define COL_YELLOW                 "{F3FF02}"
  53.     #define COL_ORANGE                 "{FFAF00}"
  54.     #define COL_LIME                   "{B7FF00}"
  55.     #define COL_CYAN                   "{00FFEE}"
  56.     #define COL_LIGHTBLUE              "{00C0FF}"
  57.     #define COL_BLUE                   "{0049FF}"
  58.     #define COL_MAGENTA                "{F300FF}"
  59.     #define COL_VIOLET                 "{B700FF}"
  60.     #define COL_PINK                   "{FF00EA}"
  61.     #define COL_MARONE                 "{A90202}"
  62.     #define COL_CMD                    "{B8FF02}"
  63.     #define COL_PARAM                  "{3FCD02}"
  64.     #define COL_SERVER                 "{AFE7FF}"
  65.     #define COL_VALUE                  "{A3E4FF}"
  66.     #define COL_RULE                   "{F9E8B7}"
  67.     #define COL_RULE2                  "{FBDF89}"
  68.     #define COL_RWHITE                 "{FFFFFF}"
  69.     #define COL_LGREEN                 "{C9FFAB}"
  70.     #define COL_LRED                   "{FFA1A1}"
  71.     #define COL_LRED2                  "{C77D87}"
  72.     #define red                        0xFF0000AA
  73.     #define yellow                     0xFFFF00AA
  74.  
  75.     new Text:Textdrawu;
  76.     new Text:Textdraws;
  77.     new Text:Textdrawl;
  78.  
  79.     public OnFilterScriptInit()
  80.     {
  81.  
  82.  
  83.             // Kuriame TextDraw'us:
  84.             Textdrawu= TextDrawCreate(412.000000, 436.000000, " ");
  85.             TextDrawBackgroundColor(Textdrawu, 255);
  86.             TextDrawFont(Textdrawu, 1);
  87.             TextDrawLetterSize(Textdrawu, 0.360000, 0.899999);
  88.             TextDrawColor(Textdrawu, 16711935);
  89.             TextDrawSetOutline(Textdrawu, 0);
  90.             TextDrawSetProportional(Textdrawu, 1);
  91.             TextDrawSetShadow(Textdrawu, 1);
  92.  
  93.             Textdraws = TextDrawCreate(177.000000, 166.000000, "Rašyk /esu norėdamas palikti AFK.");
  94.             TextDrawBackgroundColor(Textdraws, 255);
  95.             TextDrawFont(Textdraws, 1);
  96.             TextDrawLetterSize(Textdraws, 0.850000, 6.800000);
  97.             TextDrawColor(Textdraws, 16711935);
  98.             TextDrawSetOutline(Textdraws, 1);
  99.             TextDrawSetProportional(Textdraws, 1);
  100.  
  101.             Textdrawl = TextDrawCreate(272.000000, 151.000000, "AFK");
  102.             TextDrawBackgroundColor(Textdrawl, 255);
  103.             TextDrawFont(Textdrawl, 1);
  104.             TextDrawLetterSize(Textdrawl, 0.500000, 3.099999);
  105.             TextDrawColor(Textdrawl, -16776961);
  106.             TextDrawSetOutline(Textdrawl, 1);
  107.             TextDrawSetProportional(Textdrawl, 1);
  108.  
  109.  
  110.             return 1;
  111.     }
  112.  
  113.     public OnFilterScriptExit()
  114.     {
  115.             TextDrawHideForAll(Textdrawu);
  116.             TextDrawDestroy(Textdrawu);
  117.             return 1;
  118.     }
  119.  
  120.     public OnPlayerConnect(playerid)
  121.     {
  122.             Showing[playerid] = 0;
  123.     }
  124.  
  125.     public OnPlayerCommandText(playerid, cmdtext[])
  126.     {
  127.             if(!strcmp(cmdtext, "/afk") && Showing[playerid] == 0)
  128.             {
  129.             SendClientMessage(playerid, COLOR_LIME, "Nuo dabar tu esi AFK! Norėdamas sugrįžti rašyk /esu");
  130.             TogglePlayerControllable(playerid,0);
  131.             new newtext[41], name[MAX_PLAYER_NAME];
  132.             GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  133.             format(newtext, sizeof(newtext), "%s dabar yra AFK!", name);
  134.             TextDrawSetString(Textdrawu, newtext);
  135.             SetPlayerChatBubble(playerid, "AFK!", COLOR_RED, 100.0, 1000000);
  136.             TextDrawShowForAll(Textdrawu);
  137.             TextDrawShowForPlayer(playerid, Textdraws);
  138.             TextDrawShowForPlayer(playerid, Textdrawl);
  139.             SetTimerEx("HideTextdraws", 3000, 0, "i", playerid);
  140.                     return 1;
  141.             }
  142.  
  143.             if(strcmp(cmdtext,"/esu",true) == 0)
  144.         {
  145.         TextDrawHideForPlayer(playerid, Textdraws);
  146.         TextDrawHideForPlayer(playerid, Textdrawl);
  147.         TogglePlayerControllable(playerid,1);
  148.         SetPlayerChatBubble(playerid, "Back!", COLOR_RED, 100.0, 10000);
  149.         SendClientMessage(playerid,COLOR_LIME, "Jūs grįžote iš afk, sėkmės žaidime.");
  150.         return 1;
  151.             }
  152.             return 0;
  153.     }
  154.  
  155.     forward HideTextdraws(playerid);
  156.     public HideTextdraws(playerid)
  157.     {
  158.             Showing[playerid] = 0;
  159.             TextDrawHideForAll(Textdrawu);
  160.     }
Advertisement
Add Comment
Please, Sign In to add comment