Advertisement
Guest User

Untitled

a guest
Jan 6th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.82 KB | None | 0 0
  1. // FilterScript with Connect / Disconnect textdraw system made by 'NoLife' on 07/01/2019.
  2. #include <a_samp>
  3. //==============================================================================
  4. #if defined FILTERSCRIPT
  5. #define FILTERSCRIPT
  6. //==============================================================================
  7. // Textdraws
  8. new Text:ConnectDisconnectTD, TextDrawStr[3][500*3];
  9. //==============================================================================
  10. public OnGameModeInit() {
  11. ConnectDisconnectTD = TextDrawCreate(260.560607, 399.999969, "_");
  12. TextDrawLetterSize(ConnectDisconnectTD, 0.230730, 1.279165);
  13. TextDrawColor(ConnectDisconnectTD, -1);
  14. TextDrawSetShadow(ConnectDisconnectTD, 1);
  15. TextDrawSetOutline(ConnectDisconnectTD, 0);
  16. TextDrawBackgroundColor(ConnectDisconnectTD, 255);
  17. TextDrawFont(ConnectDisconnectTD, 1);
  18. TextDrawSetProportional(ConnectDisconnectTD, 1);
  19. return 1;
  20. }
  21. public OnPlayerRequestClass(playerid, classid) {
  22. TextDrawHideForPlayer(playerid, ConnectDisconnectTD);
  23. return 1;
  24. }
  25. public OnPlayerSpawn(playerid) {
  26. TextDrawShowForPlayer(playerid, ConnectDisconnectTD);
  27. return 1;
  28. }
  29. public OnPlayerConnect(playerid) {
  30. PlayerConnected(playerid);
  31. return 1;
  32. }
  33. public OnPlayerDisconnect(playerid, reason) {
  34. PlayerDisconnected(playerid, reason);
  35. return 1;
  36. }
  37. //==============================================================================
  38. // Stocks
  39. stock PlayerConnected(playerid) //You cand find this on OnPlayerConnect(playerid)
  40. {
  41. if(strlen(TextDrawStr[0]) < 5)
  42. {
  43. new rands = random(3);
  44. switch(rands)
  45. {
  46. case 0: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~g~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  47. case 1: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~b~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  48. case 2: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~p~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  49. }
  50. }
  51. else
  52. {
  53. format(TextDrawStr[2], 256*3, "%s", TextDrawStr[1]);
  54. format(TextDrawStr[1], 256*3, "%s", TextDrawStr[0]);
  55. new rands2 = random(3);
  56. switch(rands2)
  57. {
  58. case 0: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~g~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  59. case 1: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~b~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  60. case 2: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~p~~h~~h~has joined the server!", PlayerName(playerid), playerid);
  61. }
  62. }
  63. new str[256*3];
  64. format(str, sizeof(str), "~n~%s~n~%s~n~%s", TextDrawStr[0], TextDrawStr[1], TextDrawStr[2]);
  65. TextDrawSetString(ConnectDisconnectTD, str), TextDrawShowForAll(ConnectDisconnectTD); return 1;
  66. }
  67. stock PlayerDisconnected(playerid, reasonid) //You cand find this on OnPlayerDisconnect(playerid)
  68. {
  69. new ReasonOfExit[30];
  70. switch(reasonid)
  71. {
  72. case 0: ReasonOfExit = "Timeout"; case 1: ReasonOfExit = "Leaving"; case 2: ReasonOfExit = "Kicked/Banned";
  73. }
  74. if(strlen(TextDrawStr[0]) < 5)
  75. {
  76. format(TextDrawStr[0], 256*3, "~r~~h~%s(%d) ~g~~h~has left the server! ~r~~h~(%s)", PlayerName(playerid), playerid, ReasonOfExit);
  77. }
  78. else
  79. {
  80. format(TextDrawStr[2], 256*3, "%s", TextDrawStr[1]);
  81. format(TextDrawStr[1], 256*3, "%s", TextDrawStr[0]);
  82. format(TextDrawStr[0], 256*3, "~r~~h~%s(%d) ~g~~h~~h~has left the server! ~r~~h~(%s)", PlayerName(playerid), playerid, ReasonOfExit);
  83. }
  84. new str[256*3];
  85. format(str, sizeof(str), "~n~%s~n~%s~n~%s", TextDrawStr[0], TextDrawStr[1], TextDrawStr[2]);
  86. TextDrawSetString(ConnectDisconnectTD, str), TextDrawShowForAll(ConnectDisconnectTD); return 1;
  87. }
  88. // FilterScript with Connect / Disconnect textdraw system made by 'NoLife' on 07/01/2019
  89. // End of script
  90. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement