Raised This Month: $51 Target: $400
 12% 

[HELP] Freeze Zombies after Infection [ZP 5.0]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeliMeli
Senior Member
Join Date: Apr 2022
Location: Brazil
Old 08-19-2022 , 09:21   [HELP] Freeze Zombies after Infection [ZP 5.0]
Reply With Quote #1

Can someone please turn this code made for ZP 4.3 to 5.0 ? I tried and got a lot of errors.

PHP Code:
public zp_round_started(gamemodeid)
{
    new 
players[32], count
    get_players
(playerscount"ah")

    for (new 
iplayercounti++)
    {
        
player players[i]

        if (
g_zombie[player])
        {
            
freeze_player(player)
        }
    }
}

freeze_player(victim)
{
    if (
g_frozen[victim])
    {
        return
    }

    
// Freeze icon?
    
if (get_pcvar_num(cvar_hudicons))
    {
        
message_begin(MSG_ONE_UNRELIABLEg_msgDamage_victim)
        
write_byte(0// damage save
        
write_byte(0// damage take
        
write_long(DMG_DROWN// damage type - DMG_FREEZE
        
write_coord(0// x
        
write_coord(0// y
        
write_coord(0// z
        
message_end()
    }
    
    
// Light blue glow while frozen
    
if (g_handle_models_on_separate_ent)
        
fm_set_rendering(g_ent_playermodel[victim], kRenderFxGlowShell0100200kRenderNormal25)
    else
        
fm_set_rendering(victimkRenderFxGlowShell0100200kRenderNormal25)
    
    new 
sound[64]
    
// Freeze sound
    
ArrayGetString(grenade_frost_playerrandom_num(0ArraySize(grenade_frost_player) - 1), soundcharsmax(sound))
    
emit_sound(victimCHAN_BODYsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Add a blue tint to their screen
    
message_begin(MSG_ONEg_msgScreenFade_victim)
    
write_short(0// duration
    
write_short(0// hold time
    
write_short(FFADE_STAYOUT// fade type
    
write_byte(0// red
    
write_byte(50// green
    
write_byte(200// blue
    
write_byte(100// alpha
    
message_end()
    
    
// Set the frozen flag
    
g_frozen[victim] = true
    
    
// Save player's old gravity (bugfix)
    
pev(victimpev_gravityg_frozen_gravity[victim])
    
    
// Prevent from jumping
    
if (pev(victimpev_flags) & FL_ONGROUND)
        
set_pev(victimpev_gravity999999.9// set really high
    
else
        
set_pev(victimpev_gravity0.000001// no gravity
    
    // Prevent from moving
    
ExecuteHamB(Ham_Player_ResetMaxSpeedvictim)
    
    
// Set a task to remove the freeze
    
set_task(5.0"remove_freeze"victim)

MeliMeli is offline
Reply



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 05:19.


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