Raised This Month: $32 Target: $400
 8% 

Weapon Glow


Post New Thread Reply   
 
Thread Tools Display Modes
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-15-2008 , 10:01   Re: wp_glow (on ground)
Reply With Quote #11

Please list required modules in the first post.

If you are only using 1 function from fakemeta_util, it would be easiest just to include that function in your plugin and give credit for it.

For you if(get_pcvar_num(cvar)==[0|1|2]) stuff, use a switch or an if, ifelse, else statement.


Also, don't double post, edit your previous post
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Old 04-15-2008, 10:02
TheRadiance
This message has been deleted by YamiKaitou. Reason: spam
maplebest
BANNED
Join Date: May 2007
Location: Sweden, Sverige
Old 04-15-2008 , 10:04   Re: wp_glow (on ground)
Reply With Quote #12

Wow... Nice idea, +karma!
maplebest is offline
Old 04-15-2008, 10:07
spawn4071
This message has been deleted by YamiKaitou. Reason: spam
Old 04-15-2008, 10:12
YamiKaitou
This message has been deleted by YamiKaitou. Reason: reply to deleted post
Old 04-15-2008, 10:16
TheRadiance
This message has been deleted by YamiKaitou. Reason: spam
Old 04-15-2008, 10:23
Alka
This message has been deleted by YamiKaitou. Reason: reply to deleted post, but you are right :P
Old 04-15-2008, 10:31
spawn4071
This message has been deleted by YamiKaitou. Reason: spam
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 04-15-2008 , 10:37   Re: wp_glow (on ground)
Reply With Quote #13

ok sorry for flood.
First post updated.
now you can switch modes beetwen 0|1|2
0 - disables plugin
1 - team mode
2 - random colores mode
TheRadiance is offline
Send a message via ICQ to TheRadiance
vorass
Member
Join Date: Jan 2008
Old 04-15-2008 , 10:39   Re: wp_glow (on ground)
Reply With Quote #14

I cant download it some is bad with link or sth!
vorass is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-15-2008 , 10:40   Re: wp_glow (on ground)
Reply With Quote #15

Quote:
Originally Posted by YamiKaitou View Post
Please list required modules in the first post.

If you are only using 1 function from fakemeta_util, it would be easiest just to include that function in your plugin and give credit for it.

For you if(get_pcvar_num(cvar)==[0|1|2]) stuff, use a switch or an if, ifelse, else statement.


Also, don't double post, edit your previous post
Still holds true, but now I have more.

Instead of declaring 3 variables, use 1 variable and set it to a number (ie, 1 or 2 or 3).


PM me if you want me to assist you in optimizing this



Quote:
Originally Posted by vorass View Post
I cant download it some is bad with link or sth!
I downloaded it fine. You have to compile it locally though
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 04-15-2008 , 10:50   Re: wp_glow (on ground)
Reply With Quote #16

Updated again.
thnx YamiKaitou
TheRadiance is offline
Send a message via ICQ to TheRadiance
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 04-15-2008 , 11:35   Re: wp_glow (on ground)
Reply With Quote #17

Why have you included fun and fakemeta ?
__________________
atomen is offline
Send a message via MSN to atomen
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-15-2008 , 11:37   Re: wp_glow (on ground)
Reply With Quote #18

Fun is not needed, but it's not a problem to include both fakemata and fakemeta_util, as fakemeta_util won't include fakemeta then.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-15-2008 , 13:41   Re: wp_glow (on ground)
Reply With Quote #19

Here an optimized version of your current plugin.
  • Use a swith() when you can. Instead using several if() in the forward, it's better to use a switch in such case.
  • No need to create several variables 'r', 'g', 'b', use random_num() directly in the fm_set_rendering() function.
  • It's more readable to write the defined name 'PLUGIN_HANDLED', 'FMRES_IGNORED', etc.. instead of writing its value.
  • cmd_access ( id, level, cid, 2 ) : The correct value is 2 because you have to count the command + the argument, so 2.
  • In your plugin/case, no need to return something in each 'case:'. It's more readable to remove them.
  • You have forget to retrieve the mode value passed into the command.
  • Since you're using one function from fakemeta_util, just copy it into your plugin.
  • You have missed the mode value into the command function.
  • Like connor said, fun is not used, remove it.
  • (Optionnal) : Since fakemeta is using, you can use the player's private data to retrieve the team value. Then you can remove cstrike requirement.

PHP Code:
 
    
#include <amxmodx>
    #include <amxmisc>
    #include <fakemeta>

    
new gi_Mode;
    new 
gi_MaxClients;

    
enum
    
{
        
CS_TEAM_T 1,
        
CS_TEAM_CT
    
}

    
#define OFFSET_TEAM 114
    #define cs_get_user_team(%1)  get_pdata_int( %1, OFFSET_TEAM )

    
public plugin_init ()
    {
        
register_plugin "wp_glow""0.2a""Radiance" );

        
register_forward FM_SetModel"fw_model" );
        
register_concmd "amx_wpglow""cmd_wpglow"ADMIN_LEVEL_A"cmd_wpglow <1|2|3> : switches wpglow modes" );
    }

    public 
plugin_cfg ()
    {
        
gi_MaxClients global_get glb_maxClients );
    }

    public 
cmd_wpglow idlevelcid )
    {
        if ( !
cmd_access idlevelcid) )
        {
            return 
PLUGIN_HANDLED;
        }

        new 
s_Arg];
        
read_argv 1s_Argsizeof s_Arg );
        
        
gi_Mode str_to_num s_Arg );

        switch ( 
gi_Mode )
        {
            case 
1  client_print idprint_console"%s""[AMXX] wp_glow switched to <team mode>." );
            case 
2  client_print idprint_console"%s""[AMXX] wp_glow switched to <random mode>." );
            default : 
client_print idprint_console"%s""[AMXX] wp_glow disabled." );
        }

        return 
PLUGIN_HANDLED;
    }

    public 
fw_model i_Ent,  const s_Model[] )
    {
        static 
id;
        
id pev i_Entpev_owner );

        if ( !( 
<= id <= gi_MaxClients ) )
        {
            return 
FMRES_IGNORED;
        }

        switch ( 
gi_Mode )
        {
            case 
:
            {
                switch ( 
cs_get_user_team id ) )
                {
                    case 
CS_TEAM_T  fm_set_rendering i_EntkRenderFxGlowShell25500kRenderNormal10 );
                    case 
CS_TEAM_CT fm_set_rendering i_EntkRenderFxGlowShell00255kRenderNormal10 );
                }
            }
            case 
:
            {
                
fm_set_renderingi_EntkRenderFxGlowShellrandom_num1,255 ), random_num1255 ), random_num1255 ), kRenderNormal10 );
            }
        }

        return 
FMRES_IGNORED;
    }

    
fm_set_rendering i_Enti_Fx kRenderFxNonei_R 0i_G 0i_B 0i_Render kRenderNormali_Amount 16 )
    {
        static 
Float:vf_RenderColor[3];

        
vf_RenderColor] = floati_R );
        
vf_RenderColor] = floati_G );
        
vf_RenderColor] = floati_B );

        
set_pev i_Entpev_renderfx   i_Fx );
        
set_pev i_Entpev_rendercolorvf_RenderColor );
        
set_pev i_Entpev_rendermode i_Render );
        
set_pev i_Entpev_renderamt  float i_Amount ) );
    } 
__________________

Last edited by Arkshine; 04-15-2008 at 13:58.
Arkshine is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 04-15-2008 , 14:16   Re: wp_glow (on ground)
Reply With Quote #20

I don't understand why people are not using get_user_team

It does what its suppose to do, if scripters are switching teams unofficially (using offsets) then they should be complying with standards and sending the correct network messages!

If anyone can find any plugins where they don't comply with these standards, then I'll unapprove the plugin(s).


Regards,

Orangutanz
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Reply


Thread Tools
Display Modes

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 11:59.


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