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, 1 )
}
}
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(1, 1))
{
case 1: copy(g_player_model[id], charsmax( g_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(1, 1))
{
case 1: copy(g_player_model[id], charsmax( g_player_model[] ), ZOMBIE_MODEL15)
}
}
new currentmodel[32]
fm_get_user_model(id, currentmodel, charsmax(currentmodel))
if(!equal(currentmodel, g_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(id, currentmodel, charsmax(currentmodel))
if(!equal(currentmodel, g_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_SetClientKeyValue, player, engfunc(EngFunc_GetInfoKeyBuffer, player), "model", g_player_model[player])
g_has_custom_model[player] = true
}
__________________