Raised This Month: $ Target: $400
 0% 

IF statement not going through, cant figure out why....


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
samalex
Member
Join Date: Mar 2005
Old 03-31-2005 , 11:02   IF statement not going through, cant figure out why....
Reply With Quote #1

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....
samalex is offline
LynX
Veteran Member
Join Date: Oct 2004
Old 03-31-2005 , 11:23  
Reply With Quote #2

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 }
__________________
Current plugin : SoulPunisher anti-cheat
Percentage done : {||--------} 20%

If you think v3x is a PIMP, paste this into your sig!

If you think Bailopan is DA BOMB, paste this into your sig
LynX is offline
Send a message via ICQ to LynX
samalex
Member
Join Date: Mar 2005
Old 03-31-2005 , 11:28  
Reply With Quote #3

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...
samalex is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-01-2005 , 16:42  
Reply With Quote #4

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.
__________________
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
Marstuno
Junior Member
Join Date: Mar 2005
Old 04-01-2005 , 20:06  
Reply With Quote #5

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.
Marstuno is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-01-2005 , 22:49  
Reply With Quote #6

Well, I figured he could figure that out. After you know that much, it basically becomes common sense.
__________________
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
Reply


Thread Tools
Display Modes

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 09:59.


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