AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   When and where to use "if" (https://forums.alliedmods.net/showthread.php?t=10515)

clubz 02-21-2005 19:07

When and where to use "if"
 
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"?

Twilight Suzuka 02-21-2005 19:19

*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.

clubz 02-21-2005 19:22

Im sorry master, im not a l33t coder like you.

v3x 02-21-2005 19:39

LOL, well.. From my PHP coding knowledge I kinda already figured out about IF and else statements, hehe..

xeroblood 02-21-2005 20:04

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..

TaRgEt-PrAcTiCe21 02-21-2005 21:27

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.

Peli 02-21-2005 22:16

Code:
If ( ThisQuestionIsSeriouslyTrue ) {    PeliSlapsYou }

Dizzy 02-21-2005 22:25

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 }
:D


All times are GMT -4. The time now is 14:16.

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