UGX-Mods

Call of Duty 5: World at War => Help Desk => Topic started by: jjbradman on January 29, 2014, 02:05:05 am

Title: scripting question
Post by: jjbradman on January 29, 2014, 02:05:05 am
i only want to know this

Code Snippet
Plaintext
if(!IsDefined

would mean "if "is not" defined"?

so i can make something like this

if ( level.player !IsTouching( lol ) )

thanks for your attention :)
Title: Re: scripting question
Post by: daedra descent on January 29, 2014, 02:40:14 am
Code Snippet
Plaintext
if(!IsDefined

if its true

Code Snippet
Plaintext
if(IsDefined

if its not true.
Title: Re: scripting question
Post by: jjbradman on January 29, 2014, 02:59:56 am
Code Snippet
Plaintext
if(!IsDefined

if its true

Code Snippet
Plaintext
if(IsDefined

if its not true.

so this would do the trick?
Code Snippet
Plaintext
if ( level.player !IsTouching( lol ) )
are sure the "!" means true?  ???
Title: Re: scripting question
Post by: treminaor on January 29, 2014, 03:13:42 am
Code Snippet
Plaintext
if(isDefined(variable))
Checks if the variable is defined. If it is, the code in the if statement runs.

Code Snippet
Plaintext
if(!isDefined(variable))
Checks if the variable is not defined. If it is not defined, the code in the if statement runs.

It means exactly what it would mean if you read it as a sentence. "If variable is defined" and "if variable is not defined".

Code Snippet
Plaintext
!
^ means "if not".

Code Snippet
Plaintext
if(!player isTouching(trigger))
would mean "If player is not touching trigger".

The ! has to go at the beginning of the return statement when you use a function that has to be called on an entity, like isTouching().
Title: Re: scripting question
Post by: jjbradman on January 29, 2014, 03:50:34 am
lol thanks again trem :D