Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#CLIENTSIDE
- function onCreated()
- {
- setTimer( 0.05 );
- }
- function onKeyPressed( code, key )
- {
- if ( key == "a" )
- {
- if ( client.AFK != NuLL )
- {
- client.AFK = "";
- }
- }
- }
- function onPlayerChats()
- {
- if ( player.chat.starts( "/AFK" ) )
- {
- temp.AFK = player.chat.substring( 4 ).trim();
- if ( temp.AFK.length() > 100 )
- {
- player.addMsg( "Message to long." );
- return;
- }
- if ( ! temp.AFK )
- {
- player.addMsg( "Error: /afk <message>" );
- return;
- }
- client.AFK = temp.AFK;
- }
- }
- function onTimeout()
- {
- if ( client.AFK != NuLL )
- {
- freezePlayer( .5 );
- showImg( 2, "emoticon_AFK_stay.mng", playerx + 2, playery - 5 );
- changeimgvis( 2, 3 );
- showText( 1, player.x - 1.5, player.y + 2.5, "Comic Sans MS", "b", "AFK:" SPC client.AFK );
- changeimgZoom( 1, .9 );
- changeimgpart( 1, 0, 0, this.scroll, 20 );
- temp.textwidth = gettextwidth( .9, "Comic Sans MS", "b", "AFK:" SPC client.AFK );
- if ( this.scroll > 100 )
- {
- changeimgpart( 1, this.scroll2, 0, this.scroll - this.scroll2 + this.offset, 20 );
- this.scroll2 += 3;
- this.offset += 3;
- }
- else
- {
- this.scroll += 3;
- }
- if ( this.scroll2 > ( 1 * temp.textwidth ) )
- {
- this.scroll = 1;
- this.scroll2 = 0;
- this.offset = 0;
- }
- }
- else
- {
- hideImgs( 1, 2 );
- }
- setTimer( 0.05 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement