AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   IF statement not going through, cant figure out why.... (https://forums.alliedmods.net/showthread.php?t=11925)

samalex 03-31-2005 11:02

IF statement not going through, cant figure out why....
 
basically i did this:


new is_map_de

is_map_de = 1

server_print("is_map_de: %i",is_map_de)

if ( is_map_de ) {
DO THIS
}



The server prints:

is_map_de: 1

but the if statement dosent go through, whats going on? I bet im declaring it wrong or something....

LynX 03-31-2005 11:23

Code:
new is_map_de is_map_de = 1 server_print("is_map_de: %i",is_map_de) if ( is_map_de ! = 0 ) { DO THIS }

samalex 03-31-2005 11:28

edit: haha, you edit, i edit.


can you explain that "!" ?

why does it need to be there?


getting bunch of errors.

expected token ) but found !

expression has no effect

expected ; but found )




edit2: i see what you mean, you mean to do != ... That didnt work either. I really dont know why this isnt working, its not making sense...

v3x 04-01-2005 16:42

Code:
#include <amxmodx> public plugin_init() {     // .. } public myFunction() {     new is_map_de     is_map_de = 1     server_print("is_map_de: %i",is_map_de)     if ( is_map_de != 0 ) {         // ..     }     return PLUGIN_HANDLED }

!= means not equal to. So the value of is_map_de would have to hold a value greater than 0.

Marstuno 04-01-2005 20:06

Quote:

!= means not equal to. So the value of is_map_de would have to hold a value greater than 0.
To be more specific, ! is not. Paired up with an equal sign, it would read: Not Equal To.

v3x 04-01-2005 22:49

Well, I figured he could figure that out. After you know that much, it basically becomes common sense.


All times are GMT -4. The time now is 09:59.

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