Raised This Month: $ Target: $400
 0% 

UNSOLVED | Multiple ShowHudText?


Post New Thread Reply   
 
Thread Tools Display Modes
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 11-25-2014 , 17:29   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #31

If you are already storing their ready states in a global boolean variable array, then you don't need to "retrieve" those states. You already have them, in that array.

Code:
ShowHudText(i, 1, "%s: %s", clientNames[1], isReady[1] ? "is ready." : "is not ready.");
__________________
ddhoward is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 11-25-2014 , 17:30   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #32

Quote:
Originally Posted by ddhoward View Post
If you are already storing their ready states in a global boolean variable array, then you don't need to "retrieve" those states. You already have them, in that array.

Code:
ShowHudText(i, 1, "%s: %s", clientNames[1], isReady[1] ? "is ready." : "is not ready.");
Cool i'll give that a try.

Quote:
"%s: %s", clientNames[1], isReady[1] ? "is ready." : "is not ready."
EDIT: Does a bool return a string?
__________________
SourcePawn Coding Level: Novice

Last edited by DJ Data; 11-25-2014 at 17:32.
DJ Data is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 11-25-2014 , 20:59   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #33

Quote:
Originally Posted by DJ Data View Post
Cool i'll give that a try.



EDIT: Does a bool return a string?
No...
A bool returns a bool, just as an int would return an int and a string would return a string...
__________________
~Wliu
Wliu is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 11-25-2014 , 21:05   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #34

Quote:
Originally Posted by Wliu View Post
No...
A bool returns a bool, just as an int would return an int and a string would return a string...
he's asking cause of this:
Code:
isReady[1] ? "is ready." : "is not ready."
All this means is if isRead returns true then the 2nd argument will be a string: "is read" etc, etc.
Mitchell is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 11-26-2014 , 13:14   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #35

Quote:
Originally Posted by Wliu View Post
No...
A bool returns a bool, just as an int would return an int and a string would return a string...
Yeah i was confused cuz you put: "%s: %s", clientNames[1], isReady[1]
__________________
SourcePawn Coding Level: Novice
DJ Data is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 11-26-2014 , 13:29   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #36

Quote:
Originally Posted by DJ Data View Post
Yeah i was confused cuz you put: "%s: %s", clientNames[1], isReady[1]
Look at the entire thing.

Code:
isReady[1] ? "is ready." : "is not ready."
That is all a single argument. Notice the comma placement.

Code:
ShowHudText(i, 1, "%s: %s", clientNames[1], isReady[1] ? "is ready." : "is not ready.");
__________________
ddhoward is offline
DJ Data
SourceMod Donor
Join Date: Dec 2012
Location: Switzerland
Old 11-26-2014 , 13:30   Re: UNSOLVED | Multiple ShowHudText?
Reply With Quote #37

Quote:
Originally Posted by ddhoward View Post
Look at the entire thing.

Code:
isReady[1] ? "is ready." : "is not ready."
That is all a single argument. Notice the comma placement.

Code:
ShowHudText(i, 1, "%s: %s", clientNames[1], isReady[1] ? "is ready." : "is not ready.");
Oh wow, thats new to me. Didnt know that was possible
__________________
SourcePawn Coding Level: Novice
DJ Data is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:17.


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