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

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

  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.

Loading...

×
×
  • Create New...

Important Information

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