Guest User

Untitled

a guest
Jul 16th, 2018
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. /*
  2. **** AFK System - Sanel **** on fb sanel samper :D
  3. PROCITAJ DOLE POD CMD /NATRAD
  4. */
  5.  
  6.  
  7. #define FILTERSCRIPT
  8.  
  9. #include <a_samp>
  10.  
  11. new AFK[MAX_PLAYERS];
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print(" /////////////////////////////");
  16. print(" AFK System by Sanel loaded");
  17. print(" /////////////////////////////");
  18. return 1;
  19. }
  20.  
  21. public OnPlayerConnect(playerid)
  22. {
  23. AFK[playerid] = 0;
  24. return 1;
  25. }
  26.  
  27. public OnPlayerDisconnect(playerid)
  28. {
  29. AFK[playerid] = 0;
  30. return 1;
  31. }
  32.  
  33. public OnPlayerCommandText(playerid, cmdtext[])
  34. {
  35. new pname[24], str[128];
  36. GetPlayerName(playerid, pname, 24);
  37. if(!strcmp(cmdtext, "/afkzona", true))
  38. {
  39. if(AFK[playerid] == 1)
  40. {
  41. SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Vec si AFK! Upišite /natrag da biste se vratili iz AFK");
  42. return 1;
  43. }
  44. SendClientMessage(playerid, -1, "Vi ste sada AFK! Upišite /natrag da biste se vratili iz AFK");
  45. format(str, sizeof(str), "%s [%d] Je sad afk!", pname, playerid);
  46. SendClientMessageToAll(-1, str);
  47. TogglePlayerControllable(playerid, 0);
  48. SetPlayerPos(playerid, 2148.4990,1125.0457,23.3283);
  49. AFK[playerid] = 1;
  50. return 1;
  51. }
  52.  
  53. if(!strcmp(cmdtext, "/natrag", true))
  54. {
  55. if(AFK[playerid] == 0)
  56. {
  57. SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Niste AFK! Upišite /AFK da udjes u zonu");
  58. return 1;
  59. }
  60. SendClientMessage(playerid, -1, "Dobrodosao nazad:)");
  61. TogglePlayerControllable(playerid, 1);
  62. format(str, sizeof(str), "%s [%d] sada se vraca iz AFK!", pname, playerid);
  63. SendClientMessageToAll(-1, str);
  64. SpawnPlayer(playerid);// SVOJ KORDINAT OVE STAVITI SetPlayerPos(playerid, KORDINAT); DA BI SE IGRAC VRATIO NA SPAWNU
  65. AFK[playerid] = 0;
  66. return 1;
  67. }
  68. return 0;
  69. }
  70.  
  71. public OnPlayerText(playerid, text[])
  72. {
  73. if(AFK[playerid] == 1)
  74. {
  75. SendClientMessage(playerid, -1, "{FF0000}SERVER:{FFFFFF} Ti si AFK. upišite /natrag izadjes.");
  76. return 0;
  77. }
  78. return 1;
  79. }
Advertisement
Add Comment
Please, Sign In to add comment