Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Stock to freeze/unfreeze player ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 04-20-2017 , 09:20   Re: [ H3LP ] Stock to freeze/unfreeze player ?
Reply With Quote #1

example:

PHP Code:
/* Plugin generated by AMXX-Studio */

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

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

#if AMXX_VERSION_NUM < 183
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame
#endif

new g_frozen[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed"1)
    
register_forward(FM_CmdStart"fw_Start")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)

    
// Add your code here...
}
public 
client_putinserver(id)
{
    
g_frozen[id] = false
}
public 
fw_PlayerSpawn_Post(id)
{
    
// Not alive or didn't join a team yet
    
if(!is_user_alive(id))
        return;
        
    
set_task(5.0"block_speed"id)
    
}
public 
block_speed(id)
{
    if(!
is_user_alive(id))
        return;

    
    
g_frozen[id] = true
    ExecuteHamB
(Ham_Player_ResetMaxSpeedid)
}
public 
fw_Player_ResetMaxSpeed(id)
{
    if(!
is_user_alive(id))
        return;

    new 
Float:current_maxspeed
    pev
(idpev_maxspeedcurrent_maxspeed)
    
    if (
g_frozen[id])
    {
        
set_pevidpev_maxspeed1.0 )
        
entity_set_vector(idEV_VEC_velocityFloat:{0.0,0.0,0.0})
    }
}
public 
fw_Start(iduc_handleseed)
{
    static 
button button get_uc uc_handleUC_Buttons )
    static 
oldbutton oldbutton entity_get_int idEV_INT_oldbuttons )

    if(!
is_user_alive(id))
        return
        
    if (
g_frozen[id])
    {
        if(
button IN_ATTACK || button IN_ATTACK2)
        {
            
set_uc(uc_handle,UC_Buttons,(button & ~IN_ATTACK) & ~IN_ATTACK2)
        }
        else if( !(
oldbutton IN_JUMP) )
        {
            
entity_set_int(idEV_INT_oldbuttonsoldbutton IN_JUMP)
        }
    }

__________________
√ Zombie plague + greats updates. finished.
√ Surf-Mod level + greats updates Finished.
√ Zombie Scenario like cso. Finished.
Click Here
√ Call Of Duty MOD. Finished.
Click Here


Sorry for my bad english. I'm using translate.
sirerick 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 17:47.


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