tmav94 1 Posted July 30, 2015 i have the ".@char_id". How can i apply this action (query_sql) with this var? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted July 30, 2015 why use query_sql you can use this method .@acc_id = charid2rid(.@char_id);if (!.@acc_id){ debugmes "Char not online"; end;}//DO anything with .@char_id and .@acc_id here.(Character is Online) 1 tmav94 reacted to this Quote Share this post Link to post Share on other sites
0 tmav94 1 Posted July 30, 2015 This method is new for me... why use query_sql you can use this method .@acc_id = charid2rid(.@char_id);if (!.@acc_id){ debugmes "Char not online"; end;}//DO anything with .@char_id and .@acc_id here.(Character is Online) Look this other two: query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE `char`.online=1") and: if(isloggedin(getcharid(3))) They do the samething? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted July 30, 2015 This method is new for me... why use query_sql you can use this method .@acc_id = charid2rid(.@char_id);if (!.@acc_id){ debugmes "Char not online"; end;}//DO anything with .@char_id and .@acc_id here.(Character is Online) Look this other two: query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE `char`.online=1") and: if(isloggedin(getcharid(3))) They do the samething? No. getcharid(3) Means character is attached. you can do something like query_sql "SELECT `account_id` FROM `char` WHERE `char_id`='"+ .@char_id +"' AND `online`=1",.@acc_id;if (!.@acc_id){//CHARACTER IS OFFLINEend;}//CHARACTER IS ONLINE but I recommend you to use charid2rid, as its efficient as compared to executing Queries. Quote Share this post Link to post Share on other sites
i have the ".@char_id". How can i apply this action (query_sql) with this var?
Share this post
Link to post
Share on other sites