Jump to content
  • 0

if == && if != make me confused.


xeNium

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   0
  • Joined:  04/01/12
  • Last Seen:  

            case 3:

            next;    

            mes .npc$;

            mes "Last broadcast user: ^FF0000"+.lastname$+"^000000.";

            next;

            mes .npc$;

            mes "Jail this player?";

            if(select("Yes:No")==2) continue;

            atcommand "@jailfor 15n "+.lastname$;

            announce .lastname$+" has been jailed for 15 minutes for abusing the Broadcaster NPC.",0;

            next;

            mes .npc$;

            mes "Player is jailed.";

            next;

            continue;

 

Is there a way to not allow the GM to use this case 3 if the .lastname$ isn't used yet aliases, null, blank because even without the .lastname it keep jailing and announcing.

http://rathena.org/wiki/If

Edited by xeNium
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

"if == && if != make me confused."

 

To answer this...

 

== means equal to inside of a condition. Ex: "if .@container is equal to 3? Do .@container+1"

if( .@container == 3 ) { .@container++: }

&& is a way to extend the condition. It's like saying and. Ex: "if .@container is equal to 3 and .@package is equal to 4? Do .@container+1 .@package+2" 

if( .@contrainer == 1 && .@package == 4 ) { .@container++; .@package+=2; }

!= treat this like saying is not equal to. Ex: "if .@container is not equal to 3? Do .@container+1."

if( .@container != 3 ) { .@container++; }

Anyways I hope that helps a little. I don't have time for your other problem atm. :/

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...