Raised This Month: $32 Target: $400
 8% 

ZP public fw_PlayerKilled BUG


  
 
 
Thread Tools Display Modes
Author Message
fcastro16
Member
Join Date: Mar 2009
Old 04-16-2013 , 19:14   ZP public fw_PlayerKilled BUG
#1

Cuanto agrego el registro para si matan un zombie o un humano de frag, los zombies se quedan trabados. Cuando los mata un entity como un elevador o puerda. Si quito ese code el problema desaparase. Es como si los zombies no mueren completamente y su modelo queda en el mapa. Los jugadores usan esto para buggiar ammo packs.

gracias.

PHP Code:
// Ham Player Killed Forward
public fw_PlayerKilled(victimattackershouldgib)
{
    
    
// Player killed
    
g_isalive[victim] = false
    
    
// Enable dead players nightvision
    
set_task(0.1"spec_nvision"victim)
    
    
// Disable nightvision when killed (bugfix)
    
if (get_pcvar_num(cvar_nvggive) == && g_nvision[victim])
    {
        if (
get_pcvar_num(cvar_customnvg)) remove_task(victim+TASK_NVISION)
        else if (
g_nvisionenabled[victim]) set_user_gnvision(victim0)
        
g_nvision[victim] = false
        g_nvisionenabled
[victim] = false
    
}
    
    
// Turn off nightvision when killed (bugfix)
    
if (get_pcvar_num(cvar_nvggive) == && g_nvision[victim] && g_nvisionenabled[victim])
    {
        if (
get_pcvar_num(cvar_customnvg)) remove_task(victim+TASK_NVISION)
        else 
set_user_gnvision(victim0)
        
g_nvisionenabled[victim] = false
    
}
    
    
// Turn off custom flashlight when killed
    
if (g_cached_customflash)
    {
        
// Turn it off
        
g_flashlight[victim] = false
        g_flashbattery
[victim] = 100
        
        
// Remove previous tasks
        
remove_task(victim+TASK_CHARGE)
        
remove_task(victim+TASK_FLASH)
    }
    
    
// Stop bleeding/burning/aura when killed
    
if (g_zombie[victim] || g_survivor[victim] || g_sniper[victim])
    {
        
remove_task(victim+TASK_BLOOD)
        
remove_task(victim+TASK_AURA)
        
remove_task(victim+TASK_BURN)
    }
    
    
// Nemesis and Assassin explode! or when killed by a Assassin victim is cut in pieces
    
if (g_nemesis[victim] || g_assassin[victim] || ((1<=attacker<=32 && g_assassin[attacker]) && get_pcvar_num(cvar_nemfraggore)))
        
SetHamParamInteger(32)
    
    
// Get deathmatch mode status and whether the player killed himself
    
static selfkill
    selfkill 
= (victim == attacker || !is_user_valid_connected(attacker)) ? true false
    
    
// Make sure that the player was not killed by a non-player entity or through self killing
    
if (!selfkill)
    {
        
// Ignore Nemesis/Survivor/Sniper Frags?
        
if ((g_nemesis[attacker] && get_pcvar_num(cvar_nemignorefrags)) || (g_survivor[attacker] && get_pcvar_num(cvar_survignorefrags)) 
        || (
g_sniper[attacker] && get_pcvar_num(cvar_sniperignorefrags))|| (g_assassin[attacker] && get_pcvar_num(cvar_assassinignorefrags)))
            
RemoveFrags(attackervictim)
        
        
// Zombie/nemesis/assassin killed human, reward ammo packs
        
if (g_zombie[attacker] && (!g_nemesis[attacker] || !get_pcvar_num(cvar_nemignoreammo)) && (!g_assassin[attacker] || !get_pcvar_num(cvar_assassinignoreammo)))
            
g_ammopacks[attacker] += get_pcvar_num(cvar_ammoinfect)
        
        
// Human killed zombie, add up the extra frags for kill
        
if (!g_zombie[attacker] && get_pcvar_num(cvar_fragskill) > 1)
            
UpdateFrags(attackervictimget_pcvar_num(cvar_fragskill) - 100)
        
        
// Zombie killed human, add up the extra frags for kill
        
if (g_zombie[attacker] && get_pcvar_num(cvar_fragsinfect) > 1)
            
UpdateFrags(attackervictimget_pcvar_num(cvar_fragsinfect) - 100)
            
        
// When killed by a Sniper victim explodes
        
if (g_sniper[attacker] && (g_currentweapon[attacker] == CSW_AWP) && get_pcvar_num(cvar_sniperfraggore) && g_zombie[victim])
        {    
            
// Cut him into pieces
            
SetHamParamInteger(32)
            
            
// Get his origin
            
static origin[3]
            
get_user_origin(victimorigin)
            
            
// Make some blood in the air
            
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
            
write_byte(TE_LAVASPLASH// TE id
            
write_coord(origin[0]) // origin x
            
write_coord(origin[1]) // origin y
            
write_coord(origin[2] - 26// origin z
            
message_end()
        }
    }
    
    
// Respawn if deathmatch is enabled
    
if (get_pcvar_num(cvar_deathmatch) || ((g_currentmode MODE_LNJ) && (g_deathmatchmode 0)))
    {
        
// Respawn on suicide?
        
if (selfkill && !get_pcvar_num(cvar_respawnonsuicide))
            return;
        
        
// Respawn if only the last human is left?
        
if (!get_pcvar_num(cvar_respawnafterlast) && fnGetHumans() <= 1)
            return;
        
        
// Respawn if human/zombie/nemesis/assassin/survivor/sniper?
        
if ((g_zombie[victim] && !g_nemesis[victim] && !g_assassin[victim] && !get_pcvar_num(cvar_respawnzomb)) || (!g_zombie[victim] && !g_survivor[victim] && !g_sniper[victim] && !get_pcvar_num(cvar_respawnhum)) 
        || (
g_nemesis[victim] && !get_pcvar_num(cvar_respawnnem)) || (g_survivor[victim] && !get_pcvar_num(cvar_respawnsurv)) 
        || (
g_sniper[victim] && !get_pcvar_num(cvar_respawnsniper)) || (g_assassin[victim] && !get_pcvar_num(cvar_respawnassassin)))
            return;
        
        
// Respawn as zombie?
        
if ((g_currentmode MODE_LNJ) && (g_deathmatchmode 0)) // Custom round ?
        
{
            if(
g_deathmatchmode == || (g_deathmatchmode == && random_num(01)) || (g_deathmatchmode == && (fnGetZombies() < (fnGetAlive()/2))))
                
g_respawn_as_zombie[victim] = true
        
}
        else if (
get_pcvar_num(cvar_deathmatch) > 0// Normal round
        
{
            if (
get_pcvar_num(cvar_deathmatch) == || (get_pcvar_num(cvar_deathmatch) == && random_num(01)) || (get_pcvar_num(cvar_deathmatch) == && (fnGetZombies() < (fnGetAlive()/2))))
                
g_respawn_as_zombie[victim] = true
        
}
        
        
// Set the respawn task
        
set_task(get_pcvar_float(cvar_spawndelay), "respawn_player_task"victim+TASK_SPAWN)
    }
    
    if(!
g_zombie[victim]) 
    {
        
g_frags[attacker]++    // los frags aumentan, (aumentamos la variable de frags)
        
check_level(attacker// checkiamos su nivel cada vez que mate a un zombie, humano, etc 
    
}
    else
    {
        if(
g_zombie[victim])
        {
            
g_frags[attacker]++    // los frags aumentan, (aumentamos la variable de frags)
            
check_level(attacker// checkiamos su nivel cada vez que mate a un zombie, humano, etc 
        
}
        
    }
        

fcastro16 is offline
dalegato
Senior Member
Join Date: Feb 2011
Old 04-16-2013 , 19:19   Re: ZP public fw_PlayerKilled BUG
#2

creo que ese problema es porque tenes que comprabar si el jugador esta vivo creo que era asi

si no alguien que me dija y borro el comentario.
dalegato is offline
fcastro16
Member
Join Date: Mar 2009
Old 04-16-2013 , 19:49   Re: ZP public fw_PlayerKilled BUG
#3

Ya lo arregle solamente puse el registro bajo if (!selfkill)

Gracias dalegato.

Last edited by fcastro16; 04-16-2013 at 19:49.
fcastro16 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 06:54.


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