Jump to content
  • 0

DEBUG AFK AREA


deceel

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   0
  • Joined:  03/11/13
  • Last Seen:  

core,246,182,4    script    AFKMaster    -1,{

OnPCLoginEvent:

Counterstart:

set @countertime,0;
set @onArea,0;
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;

end;


OnTimer1000:

//cek pos
getmapxy( @map$, @x, @y, BL_PC );
if(@map$==$map$){
    if($X2<@x && $X1>@x){
        if($Y2<@y && $Y1>@y){
            if(@onArea!=1){
                set @onArea,1;
                dispbottom "You Are now in AFK Area!";
                set @warning,1;
            }
        }
        else{
            if(@warning==1){
                set @onArea,0;
                dispbottom "You Are Leaving AFK Area!";
                set @warning,0;
                stopnpctimer;
                goto Counterstart;
                end;
            }
        }
    }
}

if(@map$==$map$){
    if($Y2<@y && $Y1>@y){    
        if($X2<@x && $X1>@x){
            if(@onArea!=1){
                set @onArea,1;
                dispbottom "You Are now in AFK Area!";
                set @warning,1;
            }
        }
        else{
            if(@warning==1){
                set @onArea,0;
                dispbottom "You Are Leaving AFK Area!";
                set @warning,0;
                stopnpctimer;
                goto Counterstart;
                end;
            }
        }
    }
}

//cek time & reset + set prize
set @countertime,@countertime+1;
if(@countertime==($AFKTime*60)){
    if(@onArea==1){
        getitem 27004,1;
        dispbottom "You get AFK Point for stay in AFK AREA!";
        stopnpctimer;
        goto Counterstart;
    }else{
        dispbottom "You miss AFK Point Because not in AFK AREA!";
        stopnpctimer;
        goto Counterstart;
    }
}

stopnpctimer;
initnpctimer;

end;

OnInit:

set $AFKTime,30;
set @map$,"core";
set $X1,158;
set $Y1,156;
set $X2,143;
set $Y2,141;


end;    

}


someone can help me?this npc make my other npc debug auto close and stack..
Help me bro

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

On 9/23/2020 at 9:50 PM, deceel said:

core,246,182,4    script    AFKMaster    -1,{

OnPCLoginEvent:

Counterstart:

set @countertime,0;
set @onArea,0;
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;

end;


OnTimer1000:

//cek pos
getmapxy( @map$, @x, @y, BL_PC );
if(@map$==$map$){
    if($X2<@x && $X1>@x){
        if($Y2<@y && $Y1>@y){
            if(@onArea!=1){
                set @onArea,1;
                dispbottom "You Are now in AFK Area!";
                set @warning,1;
            }
        }
        else{
            if(@warning==1){
                set @onArea,0;
                dispbottom "You Are Leaving AFK Area!";
                set @warning,0;
                stopnpctimer;
                goto Counterstart;
                end;
            }
        }
    }
}

if(@map$==$map$){
    if($Y2<@y && $Y1>@y){    
        if($X2<@x && $X1>@x){
            if(@onArea!=1){
                set @onArea,1;
                dispbottom "You Are now in AFK Area!";
                set @warning,1;
            }
        }
        else{
            if(@warning==1){
                set @onArea,0;
                dispbottom "You Are Leaving AFK Area!";
                set @warning,0;
                stopnpctimer;
                goto Counterstart;
                end;
            }
        }
    }
}

//cek time & reset + set prize
set @countertime,@countertime+1;
if(@countertime==($AFKTime*60)){
    if(@onArea==1){
        getitem 27004,1;
        dispbottom "You get AFK Point for stay in AFK AREA!";
        stopnpctimer;
        goto Counterstart;
    }else{
        dispbottom "You miss AFK Point Because not in AFK AREA!";
        stopnpctimer;
        goto Counterstart;
    }
}

stopnpctimer;
initnpctimer;

end;

OnInit:

set $AFKTime,30;
set @map$,"core";
set $X1,158;
set $Y1,156;
set $X2,143;
set $Y2,141;


end;    

}


someone can help me?this npc make my other npc debug auto close and stack..
Help me bro

Change the Variable 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...