viewing paste transfer afk point to others | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
 
 
 
 
 
/*
    http://rathena.org/board/topic/95249-givepoints-script/
*/
 
 
-   script  give_afk_point  -1,{
OnInit:
    bindatcmd "giveafkpoints",strnpcinfo(0)+"::OnAtcommand";
    end;
 
OnAtcommand:
    .@target_aid = getcharid( 3,.@atcmd_parameters$[0] );
    .@point = atoi( .@atcmd_parameters$[1] );
    
    if( .@atcmd_numparameters != 2 ){
        dispbottom "Usage : "+.@atcmd_command$+" <target name> <amount>";
    }
    else if( .@point > #AFKPOINTS ){
        dispbottom "You only have "+#AFKPOINTS+" Points.";
    }
    else if( !.@target_aid ){
        dispbottom "Target not found/Offline.";
    }
    else{
        .@sender_name$ = strcharinfo(0);
        #AFKPOINTS -= .@point;
        dispbottom "Sent "+.@point+" Point to "+.@atcmd_parameters$[0];
        attachrid( .@target_aid );
        #AFKPOINTS += .@point;
        dispbottom "Received "+.@point+" Points send by "+.@sender_name$;
    }
    end;
}
Viewed 1344 times, submitted by Emistry.