Jump to content
  • 0
Brynner

how to make this source work.

Question

	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.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
    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; 

Share this post


Link to post
Share on other sites
  • 0

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 by bgamez23

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.