Jump to content
  • 0

Knowing who owns the item.


Question

Posted

Hello, I have this script that shows the amount of item that exists in the project at the time just putting the id, it would only show to admin quantiade item beyond the login id or the people who own them.

 

 

prontera,168,179,5    script    Registros ImperialRO    757,{

mes "Digite o ID do item o qual você quer saber a quantidade existente no servidor no momento.";

mes "Exemplo: ^0b85f8Rondel [1] (id: 13017).^000000";

mes "^0b85f8Chifres Místicos de Bafomé (id: 5518).^000000";

input .@item_id;

if( getitemname( .@item_id ) != "null" ){



    if( .@item_id ){

        for( set .@i,0; .@i < .sql_size; set .@i,.@i + 1 ){

            query_sql( "SELECT SUM(`amount`) FROM `"+.sql_table$[.@i]+"` WHERE `nameid`='"+.@item_id+"'",.@amount );

            query_sql( "SELECT COUNT(`card0`) FROM `"+.sql_table$[.@i]+"` WHERE `card0`='"+.@item_id+"'",.@card0 );

            query_sql( "SELECT COUNT(`card1`) FROM `"+.sql_table$[.@i]+"` WHERE `card1`='"+.@item_id+"'",.@card1 );

            query_sql( "SELECT COUNT(`card2`) FROM `"+.sql_table$[.@i]+"` WHERE `card2`='"+.@item_id+"'",.@card2 );

            query_sql( "SELECT COUNT(`card3`) FROM `"+.sql_table$[.@i]+"` WHERE `card3`='"+.@item_id+"'",.@card3 );

            set .@total,.@total + ( .@amount + .@card0 + .@card1 + .@card2 + .@card3 );

        }

            

        mes "Encontrado "+.@total+" x "+getitemname( .@item_id );

    }

}else{

    mes "ID Item inválido";

}

close;



OnInit:

setarray .sql_table$[0],"inventory","cart_inventory","guild_storage","storage","mail";

set .sql_size,getarraysize( .sql_table$ );

end;

}

2 answers to this question

Recommended Posts

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...