Try this. Not tested.
callfunc "F_Expire",Item_id;
map,x,y,z script name 100,{
input @ids;
if(callfunc("F_Expire",@ids)>0)
mes "Item "+getitemname(@ids)+" is rental";
else
mes "Item "+getitemname(@ids)+" is not rental";
close;
}
function script F_Expire {
getinventorylist;
for( set .@a,0; .@a < getarraysize(@inventorylist_id); set .@a,.@a+1)
if(getarg(0) == @inventorylist_id[.@a] && @inventorylist_expire[.@a] > 0)
return 1;
else
return 0;
}