Raised This Month: $ Target: $400
 0% 

Getting more than 1 model


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PrinceOf
Junior Member
Join Date: Mar 2011
Old 03-20-2011 , 16:02   Getting more than 1 model
Reply With Quote #1

Hello allied mods,

I am trying to get 2 players from each T and CT team , and give them a vip model and announce it to the respectful teams with an hud .... , but what is happening is :
4-5 players in each team get the vip model or the Hud shows the other teams leader ... Plz help me

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

#define TASKID_CHOOSELEADER 153

#define PLUGIN "Ghost"
#define VERSION "1.0"
#define AUTHOR "Sam"

new g_maxplayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("logevent_round_start"2"1=Round_Start")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
g_maxplayers get_maxplayers()
}

public 
plugin_precache()
{
    
precache_model("models/player/vip/vip.mdl")
}

public 
logevent_round_start()
{
    static 
id
    
for(id 1id <= g_maxplayersid++) if(is_user_alive(id))
    {
        
set_task(7.0"Leaders"id)
    }
}

public 
Leaders(id)
{
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            new 
iPlayers[32], iNumszName[32]
            
get_players(iPlayersiNum"ae""CT");
            if(
iNum
            {
                
CT(iPlayers[( iNum 1) ? random(iNum) : 0]); 
                
get_user_name(iNumszName31)
                
set_hudmessage(255000.300.3005.05.0)
                
show_hudmessage(id"%s is the Counter Terrorist Leader"szName)
            }
        }
        else if(
cs_get_user_team(id) == CS_TEAM_T)
        {
            new 
iPlayers1[32], iNum1szName1[32];
            
get_players(iPlayers1iNum1"ae""TERRORIST")
            if(
iNum1)
            {
                
T(iPlayers1[( iNum1 1) ? random(iNum1) : 0]); 
                
get_user_name(iNum1szName131)
                
set_hudmessage(255000.300.4005.05.0)
                
show_hudmessage(id"%s is the Terrorist Leader"szName1)
            }
        }
}

public 
CT(id)
{
    
cs_set_user_model(id"vip")
}

public 
T(id)
{
    
cs_set_user_model(id"vip")
}

public 
logevent_round_end()
{
    
remove_task(TASKID_CHOOSELEADER
    static 
id
    
for(id 1id <= g_maxplayersid++) if(is_user_connected(id))
    {
        
cs_reset_user_model(id)
    }

PrinceOf is offline
 


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 14:35.


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