something like this ? i havent test it.
- script atcmd_example 757,{
OnAtcommand:
mes "Buy VIP ?";
switch ( select( "VIP 7 Days","VIP 30 Days" ) ) {
// callsub L_cashpoint,<day>,<cash>;
case 1: callsub L_cashpoint,7,10; break;
case 1: callsub L_cashpoint,30,20; break;
default: break;
}
close;
L_cashpoint:
.@day = getarg( 0,0 );
.@cash = getarg( 1,0 );
mes .@day+" days VIP - "+.@cash+" cash";
if ( #CASHPOINTS >= .@cash ) {
if ( select( "Purchase","Cancel" ) == 1 ) {
#CASHPOINTS -= .@cash;
}
}
return;
OnInit:
bindatcmd "vipshop",strnpcinfo(3)+"::OnAtcommand";
end;
}