AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Freeze (https://forums.alliedmods.net/showthread.php?t=337474)

Usama Ali 04-23-2022 14:05

Freeze
 
I need a plugin which freezes zombie after infection for specific time (5 SEC), or it just takes zombies to spawn.

IM USING ZP 4.3 Fix5a

Usama Ali 04-24-2022 20:56

Re: Freeze
 
Alliedmodders have always been help-full, i have been looking for that plugin from days now

OciXCrom 04-25-2022 06:26

Re: Freeze
 
The more copy/paste threads you post, the less likely it is for you to get an answer.
I personally would have helped you, but now that I see you posted it multiple times, and all of them with incorrect (unhelpful) thread titles, I'm out.

Usama Ali 04-25-2022 15:18

Re: Freeze
 
look dude i respect you alot, your experience and everything. but will you elaborate what am i doing wrong?

CrazY. 04-25-2022 15:22

Re: Freeze
 
https://forums.alliedmods.net/showpo...43&postcount=2

Replace
Code:

public zp_round_started(gamemode, id)
{
        new players[32], count
        get_players(players, count, "ah")

        for (new i, player; i < count; i++)
        {
                player = players[i]

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

with

Code:

public zp_user_infected_post(id, infector, nemesis)
{
        if (!nemesis)
        {
                freeze_player(id)
        }
}


Usama Ali 04-25-2022 16:12

Re: Freeze
 
Quote:

Originally Posted by CrazY. (Post 2777926)
https://forums.alliedmods.net/showpo...43&postcount=2

Replace
Code:

public zp_round_started(gamemode, id)
{
        new players[32], count
        get_players(players, count, "ah")

        for (new i, player; i < count; i++)
        {
                player = players[i]

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

with

Code:

public zp_user_infected_post(id, infector, nemesis)
{
        if (!nemesis)
        {
                freeze_player(id)
        }
}


Shows Following error during compiling
Code:

error 017: undefined symbol "g_frozen"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"

Thanks for the reply

CrazY. 04-26-2022 08:24

Re: Freeze
 
I'm able to compile it just fine here.
Where did you paste the code I gave you? You should attach your zombie_plague40.sma
https://i.imgur.com/ZaYs4Y1.png

Usama Ali 04-26-2022 14:24

Re: Freeze
 
Quote:

Originally Posted by CrazY. (Post 2777990)
I'm able to compile it just fine here.
Where did you paste the code I gave you? You should attach your zombie_plague40.sma
https://i.imgur.com/ZaYs4Y1.png

Thank you so much this one works perfect.
Code:

public zp_round_started(gamemode, id)
{
        new players[32], count
        get_players(players, count, "ah")

        for (new i, player; i < count; i++)
        {
                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_UNRELIABLE, g_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], kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
        else
                fm_set_rendering(victim, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
       
        new sound[64]
        // Freeze sound
        ArrayGetString(grenade_frost_player, random_num(0, ArraySize(grenade_frost_player) - 1), sound, charsmax(sound))
        emit_sound(victim, CHAN_BODY, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
       
        // Add a blue tint to their screen
        message_begin(MSG_ONE, g_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(victim, pev_gravity, g_frozen_gravity[victim])
       
        // Prevent from jumping
        if (pev(victim, pev_flags) & FL_ONGROUND)
                set_pev(victim, pev_gravity, 999999.9) // set really high
        else
                set_pev(victim, pev_gravity, 0.000001) // no gravity
       
        // Prevent from moving
        ExecuteHamB(Ham_Player_ResetMaxSpeed, victim)
       
        // Set a task to remove the freeze
        set_task(5.0, "remove_freeze", victim)
}

But can you add a hud which shows the amount of time zombies will fe freeze.


All times are GMT -4. The time now is 10:31.

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