Jump to content
  • 0

sex identifier on search


Question

Posted

 

    mes "Please make sure to input the exact name of the player.";
    next;
    input .@n$;

mes "^ff0000"+.@n$+"^000000 "+(( .@item < 1 ) ? "has":"have" )+" ^0000ff"+ .@inv +"x ^0000ff"+ getitemname( .@item ) +"^000000 in "+( (.@sex(.@n$)) ? "his":"her" )+" account.";

hi guys how do i make this work? i always get error on the sex part...

4 answers to this question

Recommended Posts

  • 0
Posted (edited)
15 minutes ago, Cyro said:

sex == 1 // Male
sex == 0 // female

 

post your full script 

    mes "[ Account Viewer ]";
    mes "          ";
    mes "^0000ff*Input Name*^000000";
    mes "       ";
    mes "       ";
    mes "^ff0000NOTE^000000 :";
    mes "Make sure to input the exact name of the player.";
    next;
    input .@n$;
    if ( query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+ escape_sql( .@n$ ) +"'", .@a_id ) ) {
        query_sql("SELECT `char_id`, `guild_id` FROM `char` WHERE `account_id` = '"+ .@a_id +"'", .@c_id, .@g_id );
        mes "[ Account Viewer ]";
        mes "          ";
        mes "^0000ff*Input Item-ID*^000000";
    mes "       ";
    mes "       ";
    mes "^ff0000NOTE^000000 :";
    mes "Make sure to input the correct item-ID. Type @ii + item name to know the ID.";
        next;
        input .@item;
        if( getitemname( .@item ) == "" || getitemname( .@item ) == "null" ) {
            mes "[ Account Viewer ]";
            mes "^ff0000Invalid Item-ID.";
            close;
        }
        for( set .@i,0; .@i < getarraysize( .@c_id ); set .@i,.@i+1 ) {
            query_sql( "SELECT SUM(`amount`) FROM `inventory` WHERE `char_id` = "+ .@c_id[.@i] +" AND `nameid` = "+ .@item, .@count_inv );
            query_sql( "SELECT SUM(`amount`) FROM `cart_inventory` WHERE `char_id` = "+ .@c_id[.@i] +" AND `nameid` = "+ .@item, .@count_cart );
            query_sql( "SELECT SUM(`amount`) FROM `guild_storage` WHERE `guild_id` = "+ .@g_id[.@i] +" AND `nameid` = "+ .@item, .@count_gsto );
            set .@inv,.@inv + .@count_inv + .@count_cart;
            set .@gsto,.@gsto + .@count_gsto;
        }
        query_sql( "SELECT SUM(`amount`) FROM `storage` WHERE `account_id` = "+ .@a_id +" AND `nameid` = "+ .@item, .@count_sto );
        set .@inv,.@inv + .@count_sto;
    }
    else {
        mes "[ Account Viewer ]";
        mes "^ff0000"+.@n$+" does not exist.";
        close;
    }
set .@sex, Sex;
mes "[ Account Viewer ]";
mes "• ^777777Account's Storage ^00cc00CHECK^000000";
mes "• ^777777Account's Inventory ^00cc00CHECK^000000";
mes "• ^777777Account's Cart Inventory ^00cc00CHECK^000000";
mes "-----------------------------------";
mes "^ff0000"+.@n$+"^000000 "+(countitem( .@item > 1 ) ? "have":"has" )+" ^0000ff"+ .@inv +"x ^0000ff"+ getitemname( .@item ) +"^000000 "+(sex(.@n$)? "her":"his" )+" account.";
Edited by caspa
  • 0
Posted
    mes "[ Account Viewer ]";
    mes "          ";
    mes "^0000ff*Input Name*^000000";
    mes "       ";
    mes "       ";
    mes "^ff0000NOTE^000000 :";
    mes "Make sure to input the exact name of the player.";
    next;
    input .@n$;
    if ( query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+ escape_sql( .@n$ ) +"'", .@a_id ) ) {
        query_sql("SELECT `char_id`, `guild_id` FROM `char` WHERE `account_id` = '"+ .@a_id +"'", .@c_id, .@g_id );
        mes "[ Account Viewer ]";
        mes "          ";
        mes "^0000ff*Input Item-ID*^000000";
    mes "       ";
    mes "       ";
    mes "^ff0000NOTE^000000 :";
    mes "Make sure to input the correct item-ID. Type @ii + item name to know the ID.";
        next;
        input .@item;
        if( getitemname( .@item ) == "" || getitemname( .@item ) == "null" ) {
            mes "[ Account Viewer ]";
            mes "^ff0000Invalid Item-ID.";
            close;
        }
	query_sql "SELECT sex FROM login WHERE account_id = "+.@a_id,.@sex$;
        for( set .@i,0; .@i < getarraysize( .@c_id ); set .@i,.@i+1 ) {
            query_sql( "SELECT SUM(`amount`) FROM `inventory` WHERE `char_id` = "+ .@c_id[.@i] +" AND `nameid` = "+ .@item, .@count_inv );
            query_sql( "SELECT SUM(`amount`) FROM `cart_inventory` WHERE `char_id` = "+ .@c_id[.@i] +" AND `nameid` = "+ .@item, .@count_cart );
            query_sql( "SELECT SUM(`amount`) FROM `guild_storage` WHERE `guild_id` = "+ .@g_id[.@i] +" AND `nameid` = "+ .@item, .@count_gsto );
            set .@inv,.@inv + .@count_inv + .@count_cart;
            set .@gsto,.@gsto + .@count_gsto;
        }
        query_sql( "SELECT SUM(`amount`) FROM `storage` WHERE `account_id` = "+ .@a_id +" AND `nameid` = "+ .@item, .@count_sto );
        set .@inv,.@inv + .@count_sto;
    }
    else {
        mes "[ Account Viewer ]";
        mes "^ff0000"+.@n$+" does not exist.";
        close;
    }
mes "[ Account Viewer ]";
mes "• ^777777Account's Storage ^00cc00CHECK^000000";
mes "• ^777777Account's Inventory ^00cc00CHECK^000000";
mes "• ^777777Account's Cart Inventory ^00cc00CHECK^000000";
mes "-----------------------------------";
mes "^ff0000"+.@n$+"^000000 "+(countitem( .@item > 1 ) ? "have":"has" )+" ^0000ff"+ .@inv +"x ^0000ff"+ getitemname( .@item ) +"^000000 "+((.@sex$ == "F")? "her":"his" )+" account.";

Try this.

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