Advertisement
Jeaniscrazzy

"Away from keyboard system by JiC"

Jan 19th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.27 KB | None | 0 0
  1. /*-----------------------------------------------------------------------------*
  2.                                                                                |
  3.                   ___ _                                                        |
  4.                  / __) |                         _                             |
  5.          _____ _| |__| |  _     ___ _   _  ___ _| |_ _____ ____  _____         |
  6.         (____ (_   __) |_/ )   /___) | | |/___|_   _) ___ |    \| ___ |        |
  7.         / ___ | | |  |  _ (   |___ | |_| |___ | | |_| ____| | | | ____|        |
  8.         \_____| |_|  |_| \_)  (___/ \__  (___/   \__)_____)_|_|_|_____)        |
  9.                                    (____/                                      |
  10.                                                                                |
  11. I present my filterscript to you, it is a simple script of away from keyboard  |
  12. (AFK sytem).. it's really simple to use, please don't remove credits.          |
  13.                                                                                |
  14. *------------------------------------------------------------------------------*
  15. |                         Includes & Scripitng Credits :                       |
  16. |                                                                              |
  17. |            A great thnaks to the SA:MP Teams for the #include <a_samp>       |
  18. |            * Thanks to, Jeaniscrazzy for this away from keyboard scripts     |
  19. |                                                                              |
  20. *-----------------------------------------------------------------------------*/
  21. #include <a_samp>
  22. /*-----------------------------------------------------------------------------*
  23. We will use it, when a player type away from keyboard info aka /afkinfo        |
  24. *-----------------------------------------------------------------------------*/
  25. new afkinfo[1000];
  26. /*-----------------------------------------------------------------------------*
  27.  We will use it, for the dialogs "reasons" of the afk mods                     |
  28. *-----------------------------------------------------------------------------*/
  29. #define AFK 30
  30. /*-----------------------------------------------------------------------------*
  31. Samp-server.exe  black box copyrigth message of the owner of the scripts (jIc) |
  32. *-----------------------------------------------------------------------------*/
  33. #if defined FILTERSCRIPT
  34.  
  35. public OnFilterScriptInit()
  36. {
  37.     print("\n-------------------------------------------");
  38.     print(" The script is ready to be used, loading...  ");
  39.     print(" • Away from keyboard system by Jeaniscrazzy!");
  40.     print("-------------------------------------------\n");
  41.     return 1;
  42. }
  43.  
  44. #endif
  45.  
  46. /*-----------------------------------------------------------------------------*
  47. OnPlayerConnect, message will send and informations abouts our sexy afk system |
  48. *-----------------------------------------------------------------------------*/
  49. public OnPlayerConnect(playerid)
  50. {
  51.     SendClientMessage(playerid,0x0080C0C8,"* A simple away from keyboard system, by jIc | Use: /afkinfo , /afk , /back *");
  52.     // jIc (It's the abreviations of my names nicknames jeanIscrazzy)
  53.     return 1;
  54. }
  55.  
  56. public OnPlayerCommandText(playerid, cmdtext[])
  57. {
  58. /*-----------------------------------------------------------------------------*
  59.                         /AFKINFO Commands, for more info about AFKmods
  60. *-----------------------------------------------------------------------------*/
  61.     if (strcmp("/afkinfo", cmdtext, true, 10) == 0)
  62.     {
  63.         strcat(afkinfo,"{96B748}\n Rules of this system :");
  64.         strcat(afkinfo,"{5E86A2}\n - You can't spamming with the afk mods, or you will be kicked,");
  65.         strcat(afkinfo,"{5E86A2}\n - Don't use the afk mods when you see you damages or will die.");
  66.         strcat(afkinfo,"\n");
  67.         strcat(afkinfo,"{96B748}\n How to use it :");
  68.         strcat(afkinfo,"{5E86A2}\n - If you are away from key board mods, please type: /afk");
  69.         strcat(afkinfo,"{5E86A2}\n - If you are back, from your afks mods, please type: /back");
  70.         {
  71.  
  72.         ShowPlayerDialog(playerid, 45, DIALOG_STYLE_MSGBOX, "Away From Keyboard -Informations :", afkinfo, "Okay", "");
  73.         }
  74.         return 1;
  75.     }
  76. /*-----------------------------------------------------------------------------*
  77.             /BACK COMMANDS FOR USERS WHO IS BACK FROM AFK
  78. *-----------------------------------------------------------------------------*/
  79.     if (strcmp("/back", cmdtext, true, 10) == 0)
  80.     {
  81.         SendClientMessage(playerid,0x4DB357C8,"Welcome back, you are now back of your afk mods. Have fun");
  82.         SetPlayerHealth(playerid, 100);
  83.         SpawnPlayer(playerid);
  84.         UnFreezePlayer(playerid);
  85.        
  86.         return 1;
  87.     }
  88. /*-----------------------------------------------------------------------------*
  89.             /AFK FOR A PLAYER WHEN HE HES AWAY FROM KEYBOARD
  90. *-----------------------------------------------------------------------------*/
  91.     if (strcmp("/afk", cmdtext, true, 10) == 0)
  92.     {
  93.         FreezePlayer(playerid);
  94.         ShowPlayerDialog(playerid,AFK,DIALOG_STYLE_INPUT,"{4480BB}Why you will be AFK?","{FFFFFF}You  will be away from keyboard, but\nplease enter a reasons for your afk mods.","Okai","Cancel");
  95.         }
  96.     return 0;
  97. }
  98. /*-----------------------------------------------------------------------------*
  99.             DIALOG RESPONSE FOR SEND AFK REASONS TO ALL
  100. *-----------------------------------------------------------------------------*/
  101. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  102. {
  103. if(dialogid == AFK)
  104. {
  105. if(response)
  106. {
  107. SetPlayerHealth(playerid, 99999);
  108. new str[200];
  109. GetPlayerName(playerid, str, sizeof(str));
  110. format(str, sizeof(str), "{E6E61A}AFK-Informations: {FF80FF}%s{4480BB}(ID:{4DB34D}%d){4480BB} is now AFK | {4DB34D}Reasons: {4480BB}%s",str,playerid,inputtext[0]);
  111. SendClientMessageToAll(-1, str);
  112. }
  113. }
  114. return 1;
  115. }
  116. /******************************************************************************/
  117. stock FreezePlayer(playerid) // Freeze Player
  118. {
  119.     TogglePlayerControllable(playerid, 0);
  120. }
  121.  
  122. stock UnFreezePlayer(playerid) // UnFreezer Player
  123. {
  124.     TogglePlayerControllable(playerid, 1);
  125. }
  126. /*******************************************************************************/
  127. /*-----------------------------------------------------------------------------*
  128.  Here is the end of our awesome script, have fun with this I'm happy if you,   |
  129.  download it and use it on your server! Thanks you a lots, Jeaniscrazzy.       |
  130. *-----------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement