Brynner 34 Posted May 20, 2013 if( pc_has_permission(sd,PC_ANNOUNCE_TRADE) ) gm_sd = sd; if( pc_has_permission(target_sd,PC_ANNOUNCE_TRADE) ) gm_sd = target_sd; else gm_sd = NULL; i'm confuse using the if else and else if. thanks in advance. Quote Share this post Link to post Share on other sites
0 Xgear 44 Posted May 20, 2013 if( pc_has_permission(sd,PC_ANNOUNCE_TRADE) ) gm_sd = sd; else if( pc_has_permission(target_sd,PC_ANNOUNCE_TRADE) ) gm_sd = target_sd; else gm_sd = NULL; Quote Share this post Link to post Share on other sites
0 Brynner 34 Posted May 20, 2013 (edited) hmmm how about if i join the else ( pc_has_permission(sd,PC_ANNOUNCE_TRADE) )&&( pc_has_permission(target_sd,PC_ANNOUNCE_TRADE) ) gm_sd = NULL; is this possible? Edited May 20, 2013 by bgamez23 Quote Share this post Link to post Share on other sites
0 Xgear 44 Posted May 20, 2013 "else" doesnt take any arguments Its like if A = 1 then this else this What you can do is an "else if" if A = 1 then this (Do this if A is equal to 1) else if A = 2 do this2 (if A is not equal to 1 but equal to 2 do this2) else do that (If A is not equal to 1 and is NOT euql to 2, do that) I am not entirely sure what are you trying to achieve with that code but this makes more sense than what you said on your last post if( !pc_has_permission(sd,PC_ANNOUNCE_TRADE) && !pc_has_permission(target_sd,PC_ANNOUNCE_TRADE) ) gm_sd = NULL; Which basicalle says, If "sd" does not have PC_ANNOUNCE_TRADE permissions, and target_sd does not have PC_ANNOUNCE_TRADE permissions, then gm_sd is null. Quote Share this post Link to post Share on other sites
i'm confuse using the if else and else if. thanks in advance.
Share this post
Link to post
Share on other sites