Raised This Month: $ Target: $400
 0% 

What a difference between ! and != :D


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tramp
Senior Member
Join Date: Aug 2005
Old 03-23-2008 , 20:18   What a difference between ! and != :D
Reply With Quote #1

PHP Code:
    new ts[32];
    new 
cts[32];
    new 
tnum;
    new 
ctnum;
    new 
i;

    new 
specialcase 0;

    if(
ctnum==0)
    {
        
specialcase 1;
    }

        if (
ctnum==cats && tnum>=mice)
        {
            if(!
specialcase)
            {
                
set_cvar_num("sv_restart"1);
            }
        } 
Is that okey?
I dont understan this "!" in if(!specialcase)

That mean what? If it is 1 or if it is 0?

Shouldn't be like this:
if(specialcase != 1)

If i want restart when ctnum will be 0?

Thanks :>
__________________
STER-Gaming.pl - The Best Multigaming Club, CS 1.6, CS:S, ET, COD 2 more and more ! Check forum forum.ster-gaming.pl

amxmodx - Polish support about amxx.
Tramp is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2008 , 20:53   Re: What a difference between ! and != :D
Reply With Quote #2

if(ctnum==0) is the same than : if(!ctnum)

if(!specialcase) is the same than if(specialcase== 0)
__________________
Arkshine is offline
Tramp
Senior Member
Join Date: Aug 2005
Old 03-23-2008 , 21:08   Re: What a difference between ! and != :D
Reply With Quote #3

Thanks
__________________
STER-Gaming.pl - The Best Multigaming Club, CS 1.6, CS:S, ET, COD 2 more and more ! Check forum forum.ster-gaming.pl

amxmodx - Polish support about amxx.
Tramp is offline
gallucci
Junior Member
Join Date: Nov 2006
Old 03-23-2008 , 21:10   Re: What a difference between ! and != :D
Reply With Quote #4

the != operator means NOT EQUALS.

the ! operator means NOT.

so when you say if(!ctnum) its saying if ctnum equals zero (or isn't one).

You use != to test between two items, like say two integers.

if(integer1 != integer2)
client_print(0,print_chat, "The integers aren't the same");
gallucci is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-23-2008 , 21:31   Re: What a difference between ! and != :D
Reply With Quote #5

By the way, you can read the pawn language reference for more informations : http://www.compuphase.com/pawn/pawn-lang.pdf ; it's interesting.
__________________
Arkshine is offline
Tramp
Senior Member
Join Date: Aug 2005
Old 03-23-2008 , 21:51   Re: What a difference between ! and != :D
Reply With Quote #6

Yeah im trying to start, now i've read this little pawn from amxmodx on wiki.alliedmods.net ;)

Next will be this biggest one :p
__________________
STER-Gaming.pl - The Best Multigaming Club, CS 1.6, CS:S, ET, COD 2 more and more ! Check forum forum.ster-gaming.pl

amxmodx - Polish support about amxx.
Tramp is offline
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 21:08.


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