Raised This Month: $ Target: $400
 0% 

Invisibility


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-10-2011 , 11:24   Re: Invisibility
Reply With Quote #1

i is the array index, not the player index.
To get the player index, you have to index the players array.
Code:
new players[32], pnum get_players(players, pnum) new player for(new i = 0; i < pnum; i++) {     player = players[i]         // do stuff with "player" }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Pur3Biatch
Junior Member
Join Date: Jun 2011
Location: Czech Republic
Old 08-10-2011 , 11:37   Re: Invisibility
Reply With Quote #2

Well, I did as you advised ->
PHP Code:
#include <amxmodx> 
#include <engine> 
#include <fun> 
#include <fakemeta> 

#define PLUGIN "Invisibility" 
#define VERSION "1.0" 
#define AUTHOR "ConnorMcLeod" 

new g_iInvisFactor 

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    new 
iEnt 
    iEnt 
create_entity("info_target"
    
set_pev(iEntpev_classname"check_speed"
    
set_pev(iEntpev_nextthinkget_gametime() + 0.1
    
register_think("check_speed""Set_Furiens_Visibility"


public 
Set_Furiens_Visibility(iEnt

    
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1

    new 
players[32], pnumFloat:fVecVelocity[3], iSpeed 

    get_players
(playerspnum
    for(new 
0pnumi++)
    { 
        new 
player
        player 
players[i]
        if(
get_user_weapon(player) == CSW_KNIFE
        { 
            
entity_get_vector(playerEV_VEC_velocityfVecVelocity
            
iSpeed floatround(vector_length(fVecVelocity)) 
            if(
iSpeed g_iInvisFactor*255
            { 
                
set_user_rendering(playerkRenderFxNone000kRenderTransAlphaiSpeed/g_iInvisFactor
            } 
            else 
            { 
                
set_user_rendering(playerkRenderFxNone000kRenderNormal0
            } 
        } 
        else 
        { 
            
set_user_rendering(playerkRenderFxNone000kRenderNormal0
        } 
    } 

but this is still not working.
Pur3Biatch is offline
Send a message via Skype™ to Pur3Biatch
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-10-2011 , 11:42   Re: Invisibility
Reply With Quote #3

Why did you copy/paste? It was only an example.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 03:25.


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