AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Check the entity_set_float (https://forums.alliedmods.net/showthread.php?t=237580)

Flick3rR 03-26-2014 15:09

[HELP] Check the entity_set_float
 
Hi, guys! I've asked you long time ago for setting invisibility on user, so I did it (someone helped me) with engine, not wit rendering. So, I want to ask how to check if the entity_set_float is 12.75. Here is the menu option:
PHP Code:

case 8:
        {
            new 
iPari cs_get_user_money(id);
            new 
iCena get_pcvar_num(CenaInvisible);
            if (!(
is_user_alive(id)))
                {
                    
ColorMessage(id"^%s%s ^3You've to be ^4alive^3, to buy this item!"get_pcvar_num(cvar_color), Prefiks);
                    return 
PLUGIN_HANDLED;
                }
            if(!(
get_pcvar_num(Invisibleon)))
                {
                    
ColorMessage(id"^%s%s ^3Owner has disabled ^4Invisible ^3from the shop!"get_pcvar_num(cvar_color), Prefiks);
                    return 
PLUGIN_HANDLED;
                }
            if (!(
cs_get_user_money(id) >= iCena))
                {
                    
ColorMessage(id"^%s%s ^3You don't have enough ^4money!"get_pcvar_num(cvar_color), Prefiks);
                    return 
PLUGIN_HANDLED;
                }
            
entity_set_int(idEV_INT_rendermodekRenderTransAlpha);
            
entity_set_float(idEV_FL_renderamt12.75);
            
cs_set_user_money(idiPari iCena);
            
ColorMessage(id"^%s%s ^3You bought ^4Invisible"get_pcvar_num(cvar_color), Prefiks);
        } 

I think that it should be something like:
PHP Code:

if(entity_set_int(idEV_INT_rendermodekRenderTransAlpha))

or

if(
entity_get_float(idEV_FL_renderamt12.75)) 

I just want to put some other "if" in there for the invisibility check.
Really thanks to all of you! :)

Black Rose 03-26-2014 16:30

Re: [HELP] Check the entity_set_float
 
Code:
if(entity_get_int(id, EV_INT_rendermode) == kRenderTransAlpha) if(entity_get_float(id, EV_FL_renderamt) == 12.75)

Don't understand what you're using it for though.

Flick3rR 03-26-2014 16:45

Re: [HELP] Check the entity_set_float
 
Quote:

Originally Posted by Black Rose (Post 2116285)
Code:
if(entity_get_int(id, EV_INT_rendermode) == kRenderTransAlpha) if(entity_get_float(id, EV_FL_renderamt) == 12.75)

Don't understand what you're using it for though.

Well, it's about an invisibility. I just want to check if the invisibility is already set, and if it is, to return the plugin handled. That's all. I'll try it like this! Thanks. :)
P.S.: I've already said that I'm not using rendering.

----26.03.14; 22:51----
If I put these two in one check, maybe like this:
PHP Code:

if(entity_get_int(idEV_INT_rendermode) == kRenderTransAlpha
&& entity_get_float(idEV_FL_renderamt) == 12.75

will it be fine?


All times are GMT -4. The time now is 05:58.

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