iCool

iCool's Simple AFK system

May 27th, 2014
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. //Hello Everyone. This is my Fifth Filterscript.I haven't found any bugs yet.If anyone finds any, please pm me.
  2. //Please Do not repost this without my permission or remove the credits.
  3. //You will go to jail on typing /afk and be back on typin /back.
  4. //It contains only 54 lines.
  5. #include <a_samp>
  6.  
  7. #pragma tabsize 0 //For removing errors
  8.  
  9. new Float:PosX[MAX_PLAYERS], Float:PosY[MAX_PLAYERS], Float:PosZ[MAX_PLAYERS], Float:PosA[MAX_PLAYERS], PosI[MAX_PLAYERS]; //
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print("!!!iCool's AFK system has been loaded!!!");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnPlayerCommandText(playerid, cmdtext[])
  20. {
  21. if(strcmp(cmdtext, "/afk", true) == 0)
  22. {
  23. new string[256];
  24. GetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
  25. GetPlayerFacingAngle(playerid, PosA[playerid]);
  26. PosI[playerid] = (GetPlayerInterior(playerid));
  27.  
  28. SetPlayerInterior(playerid,3);
  29. SetPlayerPos(playerid,198.3797,160.8905,1003.0300);
  30. SetPlayerFacingAngle(playerid,177.0350);
  31. SetCameraBehindPlayer(playerid);
  32.  
  33. TogglePlayerControllable(playerid,0);
  34. new away[MAX_PLAYER_NAME];
  35. GetPlayerName(playerid, away, MAX_PLAYER_NAME);
  36. format(string, sizeof(string), "%s is now in AFK!", away);
  37. GameTextForAll(string, 4000, 6);
  38. return 1;
  39. }
  40. if(strcmp(cmdtext, "/back", true) == 0)
  41. {
  42. SetPlayerPos(playerid, PosX[playerid], PosY[playerid], PosZ[playerid]);
  43. SetPlayerFacingAngle(playerid, PosA[playerid]);
  44. SetCameraBehindPlayer(playerid);
  45. SetPlayerInterior(playerid, PosI[playerid]);
  46. new string[256];
  47. TogglePlayerControllable(playerid,1);
  48. new back[MAX_PLAYER_NAME];
  49. GetPlayerName(playerid, back, MAX_PLAYER_NAME);
  50. format(string, sizeof(string), "%s is BACK from AFK!", back);
  51. GameTextForAll(string, 4000, 6);
  52. return 1;
  53. }
  54. return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment