Guest User

Untitled

a guest
May 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.07 KB | None | 0 0
  1. /*
  2. Copyright by G-Mac_x3
  3. Ihr dürft es nutzen und Verändern! Allerdings nicht als euer Eigenes ausgeben!
  4. */
  5.  
  6. #include <a_samp>
  7. new Name[MAX_PLAYER_NAME];
  8. #define COLOR_GRAD3 0xCBCCCEFF
  9. #define COLOR_SYSTEM 0xEFEFF7AA
  10. new Text3D: afk;
  11. new string[128];
  12. #define Na SendClientMessage
  13. #define NaTl SendClientMessageToAll
  14. forward AfK_Init();
  15. forward AfK_Exit();
  16.  
  17. new bool:AfK[MAX_PLAYERS];
  18. public AfK_Init()
  19. {
  20.     print("AFK Include by G-Mac_x3 start");
  21. }
  22. public AfK_Exit()
  23. {
  24.     print("AfK Include by G-Mac_x3 stopp");
  25. }
  26. public OnPlayerCommandText(playerid, cmdtext[])
  27. {
  28.     if(strcmp("/afk",cmdtext,true) == 0)
  29.     {
  30.         if(AfK[playerid] == true)
  31.         {
  32.             Na(playerid, COLOR_SYSTEM, "Du bist bereits AfK");
  33.         }
  34.         else
  35.         {
  36.             GetPlayerName(playerid, Name, sizeof(Name));
  37.             format(string, sizeof(string), "%s ist AfK!", Name);
  38.             NaTl(COLOR_GRAD3, string);
  39.             Na(playerid,COLOR_SYSTEM,"Du bist nun AFK. Nutze /back um wieder am Spiel Teilzunehmen");
  40.             AfK[playerid] = true;
  41.             TogglePlayerControllable(playerid, 0);
  42.             afk = Create3DTextLabel("Spieler ist Abwesend",COLOR_GRAD3,0,0,0,20,playerid);
  43.             GameTextForPlayer(playerid, "~r~Du bist AfK nutze /back um wieder spielen zu können.", 100, 3);
  44.  
  45.         }
  46.     }
  47.     if(strcmp("/back",cmdtext,true) == 0)
  48.     {
  49.         if(AfK[playerid] == true)
  50.         {
  51.             GetPlayerName(playerid, Name, sizeof(Name));
  52.             format(string, sizeof(string), "%s ist aus dem AFK Modus zurück.", Name);
  53.             NaTl(COLOR_GRAD3, string);
  54.             Na(playerid,COLOR_SYSTEM,"Willkommen zurück");
  55.             TogglePlayerControllable(playerid, 1);
  56.             Delete3DTextLabel(afk);
  57.             AfK[playerid] = false;
  58.         }
  59.         else
  60.         {
  61.             Na(playerid,COLOR_SYSTEM,"Du bist nich AfK");
  62.  
  63.         }
  64.     }
  65.     if(strcmp("/afkliste",cmdtext, true) == 0)
  66.     {
  67.         format(string, 256, "|Diese Spieler sind AfK|");
  68.         Na(playerid,COLOR_SYSTEM,string);
  69.         for(new s; s<MAX_PLAYERS; s++)
  70.         {
  71.             if(OnPlayerConnect(s))
  72.             {
  73.                 if(AfK[s])
  74.                 {
  75.                     GetPlayerName(s,Name,sizeof(Name));
  76.                     format(string, 256, "- {FC8803}%s",string,Name);
  77.                     Na(playerid,COLOR_GRAD3,string);
  78.                 }
  79.             }
  80.         }
  81.     }
  82.     return 1;
  83. }
Add Comment
Please, Sign In to add comment