Jump to content

Question

Posted

Please help the script no check no dell items.

-    script    AntiEdit    -1,{
setarray $proibidos[0],1599,2199; // Colque os ID's dos itens proibidos

OnPCLoginEvent:
        for(set .@i,0; .@i < getarraysize($proibidos); set .@i,.@i + 1){
            query_sql "DELETE FROM `storage` WHERE `nameid` = '"+$proibidos[.@i]+"'";
            query_sql "DELETE FROM `cart_inventory` WHERE `nameid` = '"+$proibidos[.@i]+"'";
            query_sql "DELETE FROM `guild_storage` WHERE `nameid` = '"+$proibidos[.@i]+"'";
            query_sql "DELETE FROM `auction` WHERE `nameid` = '"+$proibidos[.@i]+"'";
            query_sql "DELETE FROM `mail` WHERE `nameid` = '"+$proibidos[.@i]+"'";
        if(countitem($proibidos[.@i]) >= 1){
            delitem $proibidos[.@i],1;
            dispbottom "[Segurança] "+getitemname($proibidos[.@i])+" foi deletado do seu inventário por ser um item proibido.";
            end;
        }
    }

Tanks:

3 answers to this question

Recommended Posts

  • 0
Posted
  • The array should be initialized using the OnInit event label.
  • Delete query are supposedly to execute when the server are offline, your method would not work in this case.
  • 0
Posted
3 hours ago, Emistry said:
  • The array should be initialized using the OnInit event label.
  • Delete query are supposedly to execute when the server are offline, your method would not work in this case.

 

Thank you it worked out one more thing right now. If the player has more than 1 item he does not delete all at once only one at a time how do I delete more than 1 item, or all at once?

Tanks:

  • 0
Posted
On 9/14/2017 at 6:53 PM, christofereduardo said:

 

Thank you it worked out one more thing right now. If the player has more than 1 item he does not delete all at once only one at a time how do I delete more than 1 item, or all at once?

Tanks:

 

You can also use auto delete non-existing items from trunk/conf/battle/items.conf

 

// On map change it will check for items not tagged as "available" and
// auto-delete them from inventory/cart/storage.
// NOTE: An item is not available if it was not loaded from the item_db or
// specified as unavailable in db/item_avail.txt
// 0x1: Inventory
// 0x2: Cart
// 0x4: Storage
item_check: 0x0

 

Change the item_check: 0x0   to   item_check: 0x7

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...