viewing paste restricited @item | 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
 
 
-   script  atcmd_example   -1,{
OnInit:
    bindatcmd "item",strnpcinfo(3)+"::OnAtCommand";
    setarray .item_restrict,
        607,
        7227;
    .item_restrict_size = getarraysize( .item_restrict );
    end;
OnAtCommand:
    .@gmlevel = getgmlevel();
    if( .@gmlevel && .@atcmd_numparameters ){
        .@itemid = atoi( .@atcmd_parameters$[0] );
        .@quantity = atoi( .@atcmd_parameters$[1] );
        if( .@gmlevel < 99 ){
            for( .@i = 0; .@i < .item_restrict_size; .@i++ )
                if( .@itemid == .item_restrict[.@i] ){
                    message strcharinfo(0),"Cant create this items.";
                    end;
                }
        }
        if( getitemname( .@itemid ) != "" && .@quantity ){
            getitem .@itemid,.@quantity;
        }
    }
    end;
 
}
 
Viewed 1180 times, submitted by Emistry.