Raised This Month: $ Target: $400
 0% 

Solved It's good code?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Diversity
AlliedModders Donor
Join Date: Jan 2018
Location: Constanta, Romania
Old 01-06-2018 , 01:14   Re: It's good code?
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
Your implementation of _CurWeapon() looks like it should work.

Your implementation of _MakeInvis() is not equivalent to the original code and does not match what I said. However, I just noticed that even the original implementation of _MakeInvis() is not correct because there is no "id" passed to the function. Also, you return the set_user_rendering() which means that it will only set rendering for one player. If you did not mean to do this then you should remove the return there.


So, it likely should be like this:

Code:
get alive terrorist players
loop through players[]
    if NoKnife[ id ] == 0
        set rendering
now?

Code:
public _MakeInvis( id )
{
    new players[32], asd
    get_players( players, asd, "ae", "TERRORIST" )

    if( asd == 1 )
        for(new i = 0; i < players[ 0 ] i++)
            if( NoKnife[ i ] == 0 && is_user_alive( i ) )
                set_user_rendering( i, kRenderFxNone, 0, 0, 0, kRenderTransAlpha , 0 )

    return PLUGIN_HANDLED
}
Diversity is offline
 



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 00:34.


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