Changed การเปลี่ยนแปลงส่วนต่าง ๆ

Changed ใช้ในการเช็คการเปลี่ยนแปลงค่าต่าง ๆ



default
{
    changed(integer change)
    {
        //note that it's & and not &&... it's bitwise!
        if (change & CHANGED_INVENTORY)         
        {
            llOwnerSay("inventory มีการเปลี่ยนแปลง.");
        }
        if (change & CHANGED_COLOR) 
        {
            llOwnerSay("มีการเปลี่ยนแปลง สี.");
        }
        if (change & CHANGED_SHAPE) 
        {
            llOwnerSay("มีการเปลี่ยนแปลง รูปแบบ prims  .");
        }
        if (change & CHANGED_SCALE) 
        {
            llOwnerSay("มีการเปลี่ยนแปลง ขนาด prims ");
        }
        if (change & CHANGED_TEXTURE) 
        {
            llOwnerSay("มีการเปลี่ยนแปลง texture.");
        }
        if (change & CHANGED_LINK) 
        {
            llOwnerSay("The number of links have changed.");
        }
        if (change & CHANGED_ALLOWED_DROP) 
        {
            llOwnerSay("The inventory has changed as a result of a user without mod permissions "+
                       "dropping an item on the prim and it being allowed by the script.");
        }
        if (change & CHANGED_OWNER) 
        {
            llOwnerSay("มีการเปลี่ยนแปลง เจ้าของ.");
        }
        if (change & CHANGED_REGION) 
        {
            llOwnerSay("The region the object is in has changed.");
        }
        if (change & CHANGED_TELEPORT) 
        {
            llOwnerSay("มีการ teleport");
        }
        if (change & CHANGED_REGION_START) 
        {
            llOwnerSay("The regions has just restarted.");
        }
    }
}
 
--------------------------------------------------------------------------------------------------
 
กรณี  ใช้คำสั่งเดียวกัน ในหลายเงื่อนไข
 
 if(change & (CHANGED_OWNER | CHANGED_INVENTORY)) 
            llResetScript(); 

ไม่มีความคิดเห็น:

แสดงความคิดเห็น