// Script: clear_toppings
// This script clears specific topping variables and all dynamically added toppings on the player character.

void main()
{
    object oPC = OBJECT_SELF; // Assume this script is called with the player as OBJECT_SELF

    int nToppingCount = GetLocalInt(oPC, "ToppingCount");

    // Clear specific topping variables
    DeleteLocalString(oPC, "sTopping1");
    DeleteLocalString(oPC, "sTopping2");
    DeleteLocalString(oPC, "sTopping3");
    DeleteLocalString(oPC, "sTopping4");
    DeleteLocalString(oPC, "sTopping5");

    // Clear all dynamically added topping variables up to ToppingCount
    int i;
    for (i = 1; i <= nToppingCount; i++)
    {
        DeleteLocalString(oPC, "sTopping" + IntToString(i));
    }

    // Delete the ToppingCount integer variable
    DeleteLocalInt(oPC, "ToppingCount");

    // Notify the player that toppings have been cleared
    SendMessageToPC(oPC, "Your toppings have been cleared. You can now create a new custom pizza.");
}
