AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Bitwise with enum (https://forums.alliedmods.net/showthread.php?t=324886)

Celena Luna 05-30-2020 12:14

Bitwise with enum
 
I was trying to use enum to setup bitwise for some custom ent flags but I got an error when compiling

Error
PHP Code:

Main_NPC.sma(45) : error 001expected token"{"but found "-label-" 

line 45-51:
PHP Code:

enum ( <<=1_ZOMBIE_FLAG
{
    
ZB_STATE_IDLE 1,
    
ZB_STATE_CAUTION,
    
ZB_STATE_ATTACKED,
    
ZB_STATE_CHASING


I copied the similair one from [TUT] Bits, Bit-fields, and Bit-wise Operators
How can I fix it? I am using Amx 1.10

iceeedr 05-30-2020 12:30

Re: Bitwise with enum
 
I'm not sure, but wouldn't it be?

PHP Code:

enum _ZOMBIE_FLAG ( <<=1)
{
    
ZB_STATE_IDLE 1,
    
ZB_STATE_CAUTION,
    
ZB_STATE_ATTACKED,
    
ZB_STATE_CHASING



Celena Luna 05-31-2020 00:19

Re: Bitwise with enum
 
Quote:

Originally Posted by iceeedr (Post 2703182)
I'm not sure, but wouldn't it be?

PHP Code:

enum _ZOMBIE_FLAG ( <<=1)
{
    
ZB_STATE_IDLE 1,
    
ZB_STATE_CAUTION,
    
ZB_STATE_ATTACKED,
    
ZB_STATE_CHASING



OMG it work
Thank you so much


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

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