Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. //#CLIENTSIDE
  2. function onCreated()
  3. {
  4. setTimer( 0.05 );
  5. }
  6.  
  7. function onKeyPressed( code, key )
  8. {
  9. if ( key == "a" )
  10. {
  11. if ( client.AFK != NuLL )
  12. {
  13. client.AFK = "";
  14. }
  15. }
  16. }
  17.  
  18. function onPlayerChats()
  19. {
  20. if ( player.chat.starts( "/AFK" ) )
  21. {
  22. temp.AFK = player.chat.substring( 4 ).trim();
  23. if ( temp.AFK.length() > 100 )
  24. {
  25. player.addMsg( "Message to long." );
  26. return;
  27. }
  28. if ( ! temp.AFK )
  29. {
  30. player.addMsg( "Error: /afk <message>" );
  31. return;
  32. }
  33. client.AFK = temp.AFK;
  34. }
  35. }
  36.  
  37. function onTimeout()
  38. {
  39. if ( client.AFK != NuLL )
  40. {
  41. freezePlayer( .5 );
  42. showImg( 2, "emoticon_AFK_stay.mng", playerx + 2, playery - 5 );
  43. changeimgvis( 2, 3 );
  44. showText( 1, player.x - 1.5, player.y + 2.5, "Comic Sans MS", "b", "AFK:" SPC client.AFK );
  45. changeimgZoom( 1, .9 );
  46. changeimgpart( 1, 0, 0, this.scroll, 20 );
  47. temp.textwidth = gettextwidth( .9, "Comic Sans MS", "b", "AFK:" SPC client.AFK );
  48. if ( this.scroll > 100 )
  49. {
  50. changeimgpart( 1, this.scroll2, 0, this.scroll - this.scroll2 + this.offset, 20 );
  51. this.scroll2 += 3;
  52. this.offset += 3;
  53. }
  54. else
  55. {
  56. this.scroll += 3;
  57. }
  58. if ( this.scroll2 > ( 1 * temp.textwidth ) )
  59. {
  60. this.scroll = 1;
  61. this.scroll2 = 0;
  62. this.offset = 0;
  63. }
  64. }
  65. else
  66. {
  67. hideImgs( 1, 2 );
  68. }
  69. setTimer( 0.05 );
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement