View Single Post
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-29-2011 , 17:14   Re: last player to run +duck
Reply With Quote #5

Quote:
Originally Posted by victorngl View Post
if I want to glow for the last player to run +duck, I do it?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>
#include <cstrike>

#define AUTOR "exolent"
#define VERSAO "1.0"
#define NOME "InDuck"

new g_iMax
new gLastDuckedPlayer 0;

public 
plugin_init() {
    
register_plugin(AUTORVERSAONOME)
    
register_clcmd("say /ulti" "inDuck")
    
g_iMax get_maxplayers()
    
}
public 
InDuckid )
{
    
RegisterHam(Ham_Player_Duck"player""FwdPlayerDuck"1);
}

public 
FwdPlayerDuck(id) {
    
gLastDuckedPlayer id;
    
SetGlow()
}

// ...

SetGlow() {
    
    new 
i
    
for (0<= g_iMaxi++)
    {
        
        if( 
cs_get_user_team) != CS_TEAM_T || !is_user_alive) ) {
            return 
PLUGIN_HANDLED_MAIN
        
}
        if(
gLastDuckedPlayer && is_user_connected(gLastDuckedPlayer)) {
            new 
name[32];
            
get_user_name(gLastDuckedPlayernamecharsmax(name));
            
fm_set_rendering(ikRenderFxGlowShell25000kRenderNormal20)
        }
        
    }

Why are you looping through players? You already have the player's index.
Also, you don't even need the player's name. It was just an example.
Finally, you would also need to remove glow from the player who last ducked before the newest player that last ducked.

Quote:
Originally Posted by kramesa View Post
Can I detect the first and the last player used the +jump command?
Use the same method with Ham_Player_Jump.
You would need another variable.

Code:
new gFirstPlayerJumped; new gLastPlayerJumped; // ... RegisterHam(Ham_Player_Jump, "FwdPlayerJump"); // ... public FwdPlayerJump(id) {     if(!gFirstPlayerJumped) {         gFirstPlayerJumped = id;     }     gLastPlayerJumped = id; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 12-29-2011 at 17:14.
Exolent[jNr] is offline