AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 options in client_print (https://forums.alliedmods.net/showthread.php?t=146898)

reinert 01-02-2011 17:23

2 options in client_print
 
Hey, how could I make that there will be 2 options available, like:

if 3 - iRound = 1, then it says round, otherwise rounds...

here is my code:

PHP Code:

client_print(idprint_chat"You can use this only after %d round%s"iRound"s" " "

EDIT: doh :S I searched and found answer.
Quote:

3 - iRound > 1 ? "s":""
ALSO one more question, to not create new topic I will write it here,

What is the difference between %i and %d, and which one should I use if I'm trying to print player money etc.

vL. 01-02-2011 19:24

Re: 2 options in client_print
 
Both %i and %d are for integers(1234), I use %i myself.

Quote:

Originally Posted by DarkGod (Post 1264591)
%d and %i for integers, %f for floats, %s for strings, %c for char, %a for arrays, %L for lang.

Not sure when you should use %a, though, or how it appears.


SpeeDeeR 01-03-2011 14:09

Re: 2 options in client_print
 
%a is used (around amxx 1.8 I think ? ) for string returned by the method ArrayGetStringHandle.

reinert 01-03-2011 14:20

Re: 2 options in client_print
 
I've got one more question, how could I save text into array ???

copy() ???

and then how to print it ?

fysiks 01-03-2011 14:25

Re: 2 options in client_print
 
Quote:

Originally Posted by reinert (Post 1385332)
I've got one more question, how could I save text into array ???

copy() ???

and then how to print it ?

You will need to be more specific. It really depends on what you are doing exactly. copy() will work in some situations but format() or formatex() may be better depending on your situation.

Just test it out. Use the funcwiki.


All times are GMT -4. The time now is 01:59.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.