Raised This Month: $ Target: $400
 0% 

When and where to use "if"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
clubz
Junior Member
Join Date: Dec 2004
Old 02-21-2005 , 19:07   When and where to use "if"
Reply With Quote #1

I'm starting to understand how to script more and more and what I don't get is the "if" part. When do I use em? Also when would I use "args"?
__________________
-|No suit beats it|-
cLuBz
clubz is offline
Send a message via AIM to clubz
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-21-2005 , 19:19  
Reply With Quote #2

*slaps you with a large fish*
ACTUALLY LEARN TO CODE!

An IF statement determines if a statement is true, and does the coding in the code block connected to it.

Arguements are used for getting info out of commands and functions.

....pretty pathetic that you dont even know "if" statements, and ask for help.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
clubz
Junior Member
Join Date: Dec 2004
Old 02-21-2005 , 19:22  
Reply With Quote #3

Im sorry master, im not a l33t coder like you.
__________________
-|No suit beats it|-
cLuBz
clubz is offline
Send a message via AIM to clubz
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 02-21-2005 , 19:39  
Reply With Quote #4

LOL, well.. From my PHP coding knowledge I kinda already figured out about IF and else statements, hehe..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-21-2005 , 20:04  
Reply With Quote #5

Twilight is right, you should at least learn the fundamental concepts of programming before attempting to write any code at all...

If statements are pretty basic and fundamental, and their usage can be found in almost every popular computer language out there...

I recommend learning C..
xeroblood is offline
Send a message via MSN to xeroblood
TaRgEt-PrAcTiCe21
Junior Member
Join Date: Feb 2005
Old 02-21-2005 , 21:27  
Reply With Quote #6

The way I learned to code was by looking at examples of other codes. Bascially an IF statement would go like

Code:
if (so and so = blah) {  // The { I basically like the beginging of a sentence add some code here return PLUGIN_HANDLED } // The } is like the end of the sentence
What it is is like, if this is true, then do this. And you can also continue "sentence" with an else statement.

If you don't understand it or if I gave a bad example then don't take notice to what I wrote I just started coding in general a little while ago.
TaRgEt-PrAcTiCe21 is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 02-21-2005 , 22:16  
Reply With Quote #7

Code:
If ( ThisQuestionIsSeriouslyTrue ) {    PeliSlapsYou }
Peli is offline
Send a message via MSN to Peli
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-21-2005 , 22:25  
Reply With Quote #8

Quote:
Originally Posted by Peli
Code:
If ( ThisQuestionIsSeriouslyTrue ) {    PeliSlapsYou }
lol

Code:
If ( You Don't Learn The Script ) {    set_user_health(id, get_user_health(id) - 100)    return YOUR_LIFE }
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
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 14:16.


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