AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   glow mod (https://forums.alliedmods.net/showthread.php?t=230233)

ezio_auditore 11-22-2013 04:09

glow mod
 
in my new plugin, CT1 and T1 glows at round start.

so please tell me how to transfer the glow from CT1 to KillerOfCT1 or from T1 to KillerOfT1....


also debug this code

PHP Code:

leadersHud(id) {

    
/* Skip the glowing if there's only two people playing */

    
new i_numplayers get_playersnum(0); /* get number of alive players */

    
if (i_numplayers 2) return

    
i_numplayers get_playersnum(1); /* get total number of players, including ones connecting */

    /* Figure out who the Lead Player is for each team */

    
new i_Lead_CT_frags  = -100
    
new i_Lead_T_frags   = -100
    
new i_Lead_CT_deaths = -100
    
new i_Lead_T_deaths  = -100
    
new s_team[3]
    new 
i_frags
    
new i_deaths

    g_Lead_CT 
= -1
    g_Lead_T  
= -1

    
for (new i_player 0i_player i_numplayersi_player++) {

        
i_frags  get_user_frags(i_player)
        
i_deaths get_user_deaths(i_player)

        
get_user_team(i_players_team3)

        
/* is player Lead CT? */

        
if (equali(s_team,"CT",2))
            if ((
i_frags i_Lead_CT_frags) ||
                ((
i_frags == i_Lead_CT_frags) && (i_deaths i_Lead_CT_deaths))) {

                
i_Lead_CT_frags  i_frags
                i_Lead_CT_deaths 
i_deaths
                g_Lead_CT        
i_player
            
}

        
/* is player Lead Terrorist? */

        
if (equali(s_team,"TE",2))
            if ((
i_frags i_Lead_T_frags) ||
                ((
i_frags == i_Lead_T_frags) && (i_deaths i_Lead_T_deaths))) {

                
i_Lead_T_frags  i_frags
                i_Lead_T_deaths 
i_deaths
                g_Lead_T        
i_player
            
}
    }

    
/* Make the Lead Player Glow for each team */

    
if (g_Lead_CT != -1set_user_rendering(g_Lead_CTkRenderFxGlowShell00255kRenderNormal15)

    if (
g_Lead_T  != -1set_user_rendering(g_Lead_T,  kRenderFxGlowShell25500kRenderNormal15)
    
    
set_hudmessage(1280420.150.1006.012.0)
    
show_hudmessage(id"%s is selected from Counter Terrorists^n%s is selected from Terrorists^n^nKILL THEM, THEY ARE GLOWING",g_Lead_CT,g_Lead_T)
    
    
}

public 
roundStart(id)
{    
leadersHud(id)


it shows a HUD message saying
CT is selected from Counter Terrorists
CT is selected from Terrorists

WHY?

ironskillz1 11-22-2013 05:08

Re: glow mod
 
Maybe hook Ham_kill and check if victim is glowing then set glow to killer


And you need to have get_user_name in the second code i think


All times are GMT -4. The time now is 23:14.

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