Raised This Month: $ Target: $400
 0% 

[ProblemSolved] Explanation for ? : on off menu cvar changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Basic-Master
Veteran Member
Join Date: Apr 2005
Location: hello pm
Old 04-02-2006 , 18:57  
Reply With Quote #1

hello pm!
yes, you are right, \r is case-sensitive. the meaning of the ? operator is pretty simple. it's like an if-condition but much smaller and you can use it for values only.. an example:

Code:
new gaben[64] gaben = (is_user_alive(alfred)) ? "oh, it's true, devouur!" : "NOES, damn"
this would set gaben to "oh, it's true, devouur!" if user alfred is alive. otherwise it'll be set to "NOES, damn"

you could use this, too, but nobody really likes such code parts:
Code:
new gaben[64] if (is_user_alive(alfred))   gaben = "oh, it's true, devouur!" else   gaben = "NOES, damn"

I hope I could clear that up for you.

-- Ga.. Basic-Master
Basic-Master is offline
Send a message via ICQ to Basic-Master Send a message via MSN to Basic-Master
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 16:43.


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