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

Solved plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Usama Ali
Member
Join Date: Apr 2020
Old 04-22-2022 , 16:50   plugin
Reply With Quote #1

i need a plugin which freezes the first zombies and takes him back to spawn

Last edited by Usama Ali; 04-26-2022 at 17:44.
Usama Ali is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 04-22-2022 , 19:24   Re: plugin
Reply With Quote #2

First zombies who attack players or ? Back to spawn where? Original spawn?

Last edited by raizo11; 04-22-2022 at 19:24.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Usama Ali
Member
Join Date: Apr 2020
Old 04-22-2022 , 19:34   Re: plugin
Reply With Quote #3

Yeah back to orignal spawn (from where the round starts)
Usama Ali is offline
Usama Ali
Member
Join Date: Apr 2020
Old 04-23-2022 , 12:31   Re: plugin
Reply With Quote #4

kindly anyone.. its very important
Usama Ali is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-25-2022 , 06:23   Re: plugin
Reply With Quote #5

When requesting a sub-plugin for a mod, you need to explain which mod you're using, obviously.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Usama Ali
Member
Join Date: Apr 2020
Old 04-26-2022 , 14:34   Re: plugin
Reply With Quote #6

im using zp 4.3 fix5a.. i need a plugin which after infection gets start it takes zombies back to the base.(from where the round starts)
Usama Ali is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 04-26-2022 , 16:53   Re: plugin
Reply With Quote #7

I've never played zombie plague or something similar... I don't know if it will work

Try now

Code:
#include <amxmodx>
#include <zombieplague>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
#include <engine>

#define TASKID 1337

new freeze_time,iTime,plr_solid[33],max_zombies

new spawn_back, Float:his_original_spawn[33][3];

new bool:isFreeze[33];

public plugin_init() 
{
    freeze_time = register_cvar("zp_freeze_time","20")
    spawn_back = register_cvar("zp_spawn_back","1")
    
    register_event("CurWeapon", "cur_weapon_knife", "be", "1=1", "2=29")
    register_forward(FM_UpdateClientData, "block_moving", 1)
    RegisterHam(Ham_Player_PreThink, "player", "fwd_Player_PreThink");
    RegisterHam(Ham_Spawn,"player","Player_spawn_post",1)
    
    max_zombies = get_maxplayers();
}

public cur_weapon_knife(id)
{		

    if( task_exists( TASKID ) )
           remove_task( TASKID )
    
    iTime = get_pcvar_num(freeze_time)
    
    if(is_user_alive(id) && zp_get_user_first_zombie(id))
    {
        freeze_player(id)
        isFreeze[id] = true;
	
        set_task( 1.0, "countdown", TASKID, _, _, "a", get_pcvar_num(freeze_time) )
    }
    return PLUGIN_HANDLED;
}

public freeze_player(id)
{
	//set_user_maxspeed(id,1.0)
	plr_solid[id] = SOLID_NOT;
	set_pev(id, pev_solid, SOLID_NOT);
	set_user_godmode( id, 1 );
	set_rendering(id,kRenderFxGlowShell,50,50,50,kRenderTransAdd,50)
}

public unfreeze_player(id)
{
	//set_user_maxspeed(id,250.0)
	set_user_godmode( id );
	plr_solid[id] = SOLID_SLIDEBOX;
	set_pev(id, pev_solid, SOLID_SLIDEBOX);
	set_user_rendering(id)
	
	if(get_pcvar_num(spawn_back))
             back_to_the_spawn(id)
}

public countdown()
{
    for(new id; id < max_zombies;id++)
    {
        if(is_user_connected(id) && zp_get_user_zombie(id))
        {
            if( iTime >= 2 )
            {
                iTime--

                set_dhudmessage(id, 125, 200, -1.0, 0.50, 0, 0.0, 0.5, 0.01, 1.0)
                show_dhudmessage(id, "Unfreeze start in %i seconds",iTime)
            }
            else if( iTime == 1 )
            {
                iTime--
        
                set_dhudmessage(id, 125, 200, -1.0, 0.50, 0, 0.0, 0.5, 0.01, 1.0)
                show_dhudmessage(id, "GO! GO! GO!")

                if(isFreeze[id])
	       {
	       	  unfreeze_player(id)
		  isFreeze[id] = false;
	       }
            }
        }
    }
} 

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////   Teleport To The Spawn ///////////////////////////////////////////


public Player_spawn_post(id)
{
    if(is_user_alive(id) && get_pcvar_num(spawn_back))
    {
        set_task(1.0,"get_spawn_origin",id)
        return;
   }
}

public get_spawn_origin(id)
{
    pev(id,pev_origin,his_original_spawn[id]);
}

public back_to_the_spawn(id)
{
    if(is_user_alive(id))
    {
        entity_set_origin(id,his_original_spawn[id])
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////


public block_moving(id, weapons, cd)
{
    if(isFreeze[id])
    {
        set_cd(cd, CD_flNextAttack, 0.1)
   
        if((entity_get_int(id, EV_INT_button) & (IN_MOVELEFT | IN_MOVERIGHT | IN_BACK | IN_FORWARD )))
            set_cd(cd, CD_MaxSpeed, 0.1)
    }
}

public fwd_Player_PreThink(id)
{
    if(isFreeze[id])
    {
        set_pev(id, pev_oldbuttons, pev(id, pev_oldbuttons)|IN_JUMP|IN_DUCK);
    }
}

Last edited by raizo11; 04-27-2022 at 20:26.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Usama Ali
Member
Join Date: Apr 2020
Old 04-26-2022 , 17:28   Re: plugin
Reply With Quote #8

Quote:
Originally Posted by raizo11 View Post
I've never played zombie plague or something similar... I don't know if it will work

Code:
#include <amxmodx>
#include <zombieplague>
#include <hamsandwich>
#include <fun>
#include <fakemeta>
#include <engine>

#define TASKID 1337

new freeze_time,iTime,plr_solid[33],max_zombies

new spawn_back, Float:his_original_spawn[33][3];

public plugin_init() 
{
    freeze_time = register_cvar("zp_freeze_time","20")
    spawn_back = register_cvar("zp_spawn_back","1")
    
    register_event("CurWeapon", "cur_weapon_knife", "be", "1=1", "2=29")
    
    RegisterHam(Ham_Spawn,"player","Player_spawn_post",1)
    
    max_zombies = get_maxplayers();
}

public cur_weapon_knife(id)
{		

    if( task_exists( TASKID ) )
           remove_task( TASKID )
    
    iTime = get_pcvar_num(freeze_time)
    
    if(is_user_alive(id) && zp_get_user_first_zombie(id))
    {
        freeze_player(id)
	
        set_task(get_pcvar_float(freeze_time), "unfreeze_player", id)
	
        set_task( 1.0, "countdown", TASKID, _, _, "a", get_pcvar_num(freeze_time) )
    }
    return PLUGIN_HANDLED;
}

public freeze_player(id)
{
	set_user_maxspeed(id,1.0)
	plr_solid[id] = SOLID_NOT;
	set_pev(id, pev_solid, SOLID_NOT);
	set_user_godmode( id, 1 );
	set_rendering(id,kRenderFxGlowShell,50,50,50,kRenderTransAdd,50)
}

public unfreeze_player(id)
{
	set_user_maxspeed(id,250.0)
	set_user_godmode( id );
	plr_solid[id] = SOLID_SLIDEBOX;
	set_pev(id, pev_solid, SOLID_SLIDEBOX);
	set_user_rendering(id)
	
	if(get_pcvar_num(spawn_back))
             back_to_the_spawn(id)
}

public countdown()
{
    for(new id; id < max_zombies;id++)
    {
        if(is_user_connected(id) && zp_get_user_zombie(id))
        {
            if( iTime >= 2 )
            {
                iTime--

                set_dhudmessage(id, 125, 200, -1.0, 0.50, 0, 0.0, 0.5, 0.01, 1.0)
                show_dhudmessage(id, "Unfreeze start in %i seconds",iTime)
            }
            else if( iTime == 1 )
            {
                iTime--
        
                set_dhudmessage(id, 125, 200, -1.0, 0.50, 0, 0.0, 0.5, 0.01, 1.0)
                show_dhudmessage(id, "GO! GO! GO!")
            }
        }
    }
} 

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////   Teleport To The Spawn ///////////////////////////////////////////


public Player_spawn_post(id)
{
    if(is_user_alive(id) && get_pcvar_num(spawn_back))
    {
        set_task(1.0,"get_spawn_origin",id)
        return;
   }
}

public get_spawn_origin(id)
{
    pev(id,pev_origin,his_original_spawn[id]);
}

public back_to_the_spawn(id)
{
    if(is_user_alive(id))
    {
        entity_set_origin(id,his_original_spawn[id])
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
it works thank you.

Last edited by Usama Ali; 04-26-2022 at 17:44.
Usama Ali is offline
Dyaus
Member
Join Date: Aug 2021
Old 04-27-2022 , 08:54   Re: plugin
Reply With Quote #9

Quote:
Originally Posted by raizo11 View Post

Code:
public unfreeze_player(id)
{
	set_user_maxspeed(id,250.0)
	set_user_godmode( id );
	plr_solid[id] = SOLID_SLIDEBOX;
	set_pev(id, pev_solid, SOLID_SLIDEBOX);
	set_user_rendering(id)
	
	if(get_pcvar_num(spawn_back))
             back_to_the_spawn(id)
}
in zombie plague different zombie classes have different speed so in the unfreeze phase you need to set it back to original zombie speed not the default 250.0 value , use a variable to store the player's maxspeed before freezing him and in the unfreeze phase use that .

Code:
public zp_user_infected_post(id, infector)
{
	Ospeed = get_user_maxspeed(id)
}
public unfreeze_player(id)
{
	set_user_maxspeed(id,Ospeed)
	set_user_godmode( id );
	plr_solid[id] = SOLID_SLIDEBOX;
	set_pev(id, pev_solid, SOLID_SLIDEBOX);
	set_user_rendering(id)
	
	if(get_pcvar_num(spawn_back))
             back_to_the_spawn(id)
}
Dyaus 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 06:42.


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