Jump to content
  • 0

Simple plural/singular question.


Auryn

Question


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Could someone tell me, or help me about thinking how I could make the word "player(s)" be in plural if there is more 1 player in the room, and stay singular if there is only one, instead of a permanent, ugly "player(s)" ?

OnInit:
do {
delwaitingroom;
waitingroom "PvP [" +getmapusers("pvp_n_8-5") +" player(s)]",0,"PvP Warp::OnStart",1;
enablewaitingroomevent;
sleep 1000;
} while(1);
end;
}

This is a "Waiting Room" in my PvP Warper script.

Edited by Auryn
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

   set .@n, getmapusers("pvp_n_8-5");
   waitingroom "PvP [" +.@n +" player"+((.@n==1)?"":"s")+"]",0,"PvP Warp::OnStart",1;

ref: Tips_and_Tricks_(Scripting)#Compact_IF_Statement

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  147
  • Reputation:   1
  • Joined:  01/26/12
  • Last Seen:  

Ok, thank you Euphy, this is what I was looking for.

Edited by Auryn
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...