Raised This Month: $ Target: $400
 0% 

[HELP] how to reset Terror deaths in next round?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 07-24-2010 , 02:28   [HELP] how to reset Terror deaths in next round?
Reply With Quote #1

I tried this but it doesnt works.

PHP Code:
public event_round_start()
{
set_task(20.0"reset_deaths")
}

public 
reset_deaths(id) {       
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        
cs_set_user_deaths id)
    }

Please help! thanks in advance!

also i got another problem:

The Custom Boss model doesnt work and only shows the Zombie model.
but after The player dies the boss model shows up in his respawn but its class is a normal zombie not a boss zombie.
PHP Code:
public ham_player_spawn(id)
{
    if(!
is_user_alive(id) || !cs_get_user_team(id))
        return
    
g_zombie[id] = cs_get_user_team(id) == CS_TEAM_T true false
    remove_task
(id 100)
    if(
g_zombie[id])
    {
        switch (
random_num(11))
        {
            case 
1copy(g_player_model[id], charsmaxg_player_model[] ), ZOMBIE_MODEL1)
                
/*case 2: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL2)
                case 3: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL3)
            case 4: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL4)
                case 5: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL5)
                case 6: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL6)
                case 7: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL7)
                case 8: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL8)
                case 9: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL9)
                case 10: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL10)
                case 11: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL11)
                case 12: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL12)
                case 13: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL13)
                case 14: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL14)
                case 15: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL15)*/
            
}
        if(
g_boss_class[id])
            {
                switch (
random_num(11))
                {
                    case 
1copy(g_player_model[id], charsmaxg_player_model[] ), ZOMBIE_MODEL15)
                }
            }
        new 
currentmodel[32]
        
fm_get_user_model(idcurrentmodelcharsmax(currentmodel))
        if(!
equal(currentmodelg_player_model[id]))
        {
            if(
get_gametime() - g_roundstart_time 5.0)
                
set_task(5.0 0.5"fm_user_model_update"id 100)
            else
                
fm_user_model_update(id 100)
        }
    }
        
    else if(
g_has_custom_model[id])
        {
            
fm_reset_user_model(id)
        }
    }
    
    public 
fm_client_key(id, const infobuffer[], const key[])
    {   
        if(
g_has_custom_model[id] && equal(key"model"))
            return 
FMRES_SUPERCEDE
        
return FMRES_IGNORED
    
}
    
    public 
fm_client_info(id)
    {
        if(!
g_has_custom_model[id])
            return 
FMRES_IGNORED
        
        
static currentmodel[32]
        
fm_get_user_model(idcurrentmodelcharsmax(currentmodel))
        if(!
equal(currentmodelg_player_model[id]) && !task_exists(id 100))
            
fm_set_user_model(id 100)
        return 
FMRES_IGNORED
    
}
    
    public 
fm_user_model_update(taskid)
    {
        static 
Float:current_time
        current_time 
get_gametime()
        
        if(
current_time g_models_target_time >= 0.5)
        {
            
fm_set_user_model(taskid)
            
g_models_target_time current_time
        
}
        else
        {
            
set_task((g_models_target_time 0.5) - current_time"fm_set_user_model"taskid)
            
g_models_target_time g_models_target_time 0.5
        
}
    }
    
    public 
fm_set_user_model(player)
    {
        
player -= 100
        engfunc
(EngFunc_SetClientKeyValueplayerengfunc(EngFunc_GetInfoKeyBufferplayer), "model"g_player_model[player])
        
g_has_custom_model[player] = true
    

__________________
jc980 is offline
RedRobster
Veteran Member
Join Date: Apr 2010
Location: Your Closet
Old 07-24-2010 , 02:38   Re: [HELP] how to reset Terror deaths in next round?
Reply With Quote #2

On the first one, you don't pass an id in the set_task().

You are going to have to loop through all of the players and set the deaths there.
RedRobster is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-24-2010 , 02:45   Re: [HELP] how to reset Terror deaths in next round?
Reply With Quote #3

Post the full code for the second one?

Also for the first one:

Code:
public event_round_start() 
{ 
set_task(20.0, "reset_deaths") 
} 

public reset_deaths() {
    new players[32], player, num
    get_players(players, num)
    for(new i;i<num;i++)
    {
     player=players[i]
    if(cs_get_user_team(player) == CS_TEAM_T) 
    { 
        cs_set_user_deaths (player, 1 ) 
    } 
}  
}

nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 07-24-2010 , 03:06   Re: [HELP] how to reset Terror deaths in next round?
Reply With Quote #4

Quote:
Originally Posted by nikhilgupta345 View Post
Post the full code for the second one?

Also for the first one:

Code:
public event_round_start() 
{ 
set_task(20.0, "reset_deaths") 
} 

public reset_deaths() {
    new players[32], player, num
    get_players(players, num)
    for(new i;i<num;i++)
    {
     player=players[i]
    if(cs_get_user_team(player) == CS_TEAM_T) 
    { 
        cs_set_user_deaths (player, 1 ) 
    } 
}  
}

thanks for the first one.

the whole code?

how about the sma file? will that do?
Attached Files
File Type: sma Get Plugin or Get Source (CSO_ZBScenario.sma - 543 views - 101.1 KB)
__________________
jc980 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 00:10.


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