AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Freeze Zombies after Infection [ZP 5.0] (https://forums.alliedmods.net/showthread.php?t=339149)

MeliMeli 08-19-2022 09:21

[HELP] Freeze Zombies after Infection [ZP 5.0]
 
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)




All times are GMT -4. The time now is 15:35.

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