hi this is part of the script that lets you see and display all online characters on the server right now
what i'm trying to do is if a character has a VIP ticket there would be a "(VIP)" next to his name.. so far i have done this... however is there a much more efficient?
mes "[ Control Panel ]";
mes "^ff0000Online Users^000000 :";
//----------------------------------------------------------------------------------------------------------------
set .@size, query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `level` > 0 ) ORDER BY `name` DESC LIMIT 128", .@name$ );
//-----------------------------------------------------------------------------------------------------------------
for( set .@i,0; .@i < .@size; set .@i,.@i+1 ) {
//---------------------------------------------------------------------------
set .@cid, getcharid(0,.@name$[.@i]);
set .@did, getcharid(0,.@name$[.@i]);
set .@item1, 21026;
set .@count1, countitem(21026);
set .@item2, 21027;
set .@count2, countitem(21027);
//---------------------------------------------------------------------------
query_sql("SELECT SUM(`amount`) FROM `inventory` WHERE `char_id` = "+.@cid+" AND `nameid` = "+.@item1,.@count1);
query_sql("SELECT SUM(`amount`) FROM `inventory` WHERE `char_id` = "+.@did+" AND `nameid` = "+.@item2,.@count2);
//---------------------------------------------------------------------------
mes "^0000ff"+( .@i+1 ) +".^000000 ^007700"+ .@name$[.@i] +" "+( .@count1 == 1 ? "(VIP)" : "" ) +""+( .@count2 == 1 ? "(VIP)" : "" ) +"^000000";
}
Question
caspa
hi this is part of the script that lets you see and display all online characters on the server right now
what i'm trying to do is if a character has a VIP ticket there would be a "(VIP)" next to his name.. so far i have done this... however is there a much more efficient?
Link to comment
Share on other sites
3 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.