AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved [Request] Freeze Player For 1 Second When Spawned (https://forums.alliedmods.net/showthread.php?t=340218)

Snake. 11-03-2022 14:20

[Request] Freeze Player For 1 Second When Spawned
 
I want players to get freezed for 1 second as soon as they spawned. They won't be able to do anything while freezed (jump, crouch, move)

Nutu_ 11-03-2022 16:58

Re: [Request] Freeze Player For 1 Second When Spawned
 
mp_freezetime 1?

Snake. 11-03-2022 17:21

Re: [Request] Freeze Player For 1 Second When Spawned
 
Quote:

Originally Posted by Nutu_ (Post 2792072)
mp_freezetime 1?

Sorry, i forgot to mention that my server has auto-respawn feature and unlimited round time.

Nutu_ 11-03-2022 18:28

Re: [Request] Freeze Player For 1 Second When Spawned
 
send the auto-respawn code

Snake. 11-06-2022 11:00

Re: [Request] Freeze Player For 1 Second When Spawned
 
Quote:

Originally Posted by Nutu_ (Post 2792082)
send the auto-respawn code

PHP Code:

public plugin_init() 
{
    
register_plugin("[Respawn]""1.0"PluginAuthor);
    
    
register_clcmd("say /start""Command_Respawn");
    
register_clcmd("say /respawn""Command_Respawn");
    

    
register_forward(FM_PlayerPreThink"CBasePlayer_PreThink");

    
register_forward(FM_PlayerPreThink"CBasePlayer_PreThink_BlockUse");
    
register_forward(FM_ClientKill"CBasePlayer_KillCommand");
    
register_forward(FM_AddToFullPack"AddToFullPack_Post"1);    
    
}

public 
Command_Start(id)
{
    if (!
is_user_connected(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)         return;

    
ExecuteHamB(Ham_CS_RoundRespawnid);
    
cs_set_user_deaths(idcs_get_user_money(id));
    
give_item(id"weapon_usp");
    
set_user_health (id 10084);
}
public 
Command_Respawn(id
{
    if(
is_user_alive(id)) 
    { 
        
Command_Start(id);
    }
    return 
PLUGIN_HANDLED;
}
public 
CBasePlayer_KillCommand(id
{
    
Command_Start(id);    
    return 
HAM_SUPERCEDE;
}
public 
Ham_PlayerAlready_Killed(id
{        
    
set_task(0.1"Command_Start"id);    
}

public 
client_PreThink(id
{
    if(
get_user_health(id) < 9984) {
        
Command_Start(id)
    }



Nutu_ 11-06-2022 15:47

Re: [Request] Freeze Player For 1 Second When Spawned
 
try adding this to your code -> https://forums.alliedmods.net/showth...98#post2510998

Gabrielx 11-07-2022 08:09

Re: [Request] Freeze Player For 1 Second When Spawned
 
Try this:
PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>


#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
}

public 
fwHamPlayerSpawnPost(id)
{
        
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) | FL_FROZEN);
        
set_task(1.0"unfreeze"id);
}

public 
unfreeze(id)
    
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) & ~FL_FROZEN); 


Snake. 11-07-2022 10:33

Re: [Request] Freeze Player For 1 Second When Spawned
 
Thank you both

Quote:

Originally Posted by Gabrielx (Post 2792326)
Try this:
PHP Code:

#include <amxmodx>
#include <engine>
#include <hamsandwich>


#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
}

public 
fwHamPlayerSpawnPost(id)
{
        
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) | FL_FROZEN);
        
set_task(1.0"unfreeze"id);
}

public 
unfreeze(id)
    
entity_set_int(idEV_INT_flagsentity_get_int(idEV_INT_flags) & ~FL_FROZEN); 


Quote:

Originally Posted by Nutu_ (Post 2792284)



All times are GMT -4. The time now is 23:57.

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