AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Walhang (https://forums.alliedmods.net/showthread.php?t=210253)

layka_LUBII 03-08-2013 10:31

Walhang
 
Hello, My plugin doesn't work please repair thank you :D


Code:

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

#define PLAYER_JUMP            6

#define ACT_HOP        7

#define XTRA_OFS_PLAYER            5
#define m_Activity                73
#define m_IdealActivity            74
#define m_flNextAttack            83
#define m_afButtonPressed        246
#define PLAYER_JUMP        6
#define MAX_PLAYERS        32 
#define IsPlayer(%1)    ( FIRST_PLAYER_ID <= %1 <= g_iMaxPlayers )
#define FIRST_PLAYER_ID    1

new g_iMaxPlayers
new g_bHasWallHang
#define SetUserWallHang(%1)        g_bHasWallHang |=    1<<(%1&31)
#define RemoveUserWallHang(%1)    g_bHasWallHang &=    ~(1<<(%1&31))
#define HasUserWallHang(%1)        g_bHasWallHang &    1<<(%1&31)

new g_bHanged
#define SetUserHanged(%1)    g_bHanged |=    1<<(%1&31)
#define RemoveUserHanged(%1)    g_bHanged &=    ~(1<<(%1&31))
#define IsUserHanged(%1)        g_bHanged &    1<<(%1&31)

new Float:g_fVecMins[MAX_PLAYERS+1][3]
new Float:g_fVecMaxs[MAX_PLAYERS+1][3]
new Float:g_fVecOrigin[MAX_PLAYERS+1][3]

public plugin_init()
{
    register_plugin("Walhang", "1.0", "Slavomírek")
    RegisterHam(Ham_Player_Jump, "player", "Player_Jump")
    RegisterHam(Ham_Touch, "func_wall", "World_Touch")
    RegisterHam(Ham_Touch, "func_breakable", "World_Touch")
    RegisterHam(Ham_Touch, "worldspawn", "World_Touch")   
   
    g_iMaxPlayers = get_maxplayers()   
}


public Player_Jump(id)
{
    if(  ~HasUserWallHang(id)
    ||    ~IsUserHanged(id)
    ||    !is_user_alive(id)    )
    {
        return HAM_IGNORED
    }

    if( (pev(id, pev_flags) & FL_WATERJUMP) || pev(id, pev_waterlevel) >= 2 )
    {
        return HAM_IGNORED
    }

    static afButtonPressed ; afButtonPressed = get_pdata_int(id, m_afButtonPressed)

    if( ~afButtonPressed & IN_JUMP )
    {
        return HAM_IGNORED
    }

    RemoveUserHanged(id)

    new Float:fVecVelocity[3]

    velocity_by_aim(id, 600, fVecVelocity)
    set_pev(id, pev_velocity, fVecVelocity)

    set_pdata_int(id, m_Activity, ACT_HOP)
    set_pdata_int(id, m_IdealActivity, ACT_HOP)
    set_pev(id, pev_gaitsequence, PLAYER_JUMP)
    set_pev(id, pev_frame, 0.0)
    set_pdata_int(id, m_afButtonPressed, afButtonPressed & ~IN_JUMP)

    return HAM_SUPERCEDE
}


public client_PostThink(id)
{
    if( HasUserWallHang(id) && IsUserHanged(id) )
    {
        engfunc(EngFunc_SetSize, id, g_fVecMins[ id ], g_fVecMaxs[ id ])
        engfunc(EngFunc_SetOrigin, id, g_fVecOrigin[ id ])
        set_pev(id, pev_velocity, 0)
        set_pdata_float(id, m_flNextAttack, 1.0, XTRA_OFS_PLAYER)
    }
}

public World_Touch(iEnt, id)
{
    if(  IsPlayer(id)
    &&    HasUserWallHang(id)
    &&    ~IsUserHanged(id)
    &&    is_user_alive(id)
    &&    pev(id, pev_button) & IN_USE
    &&    ~pev(id, pev_flags) & FL_ONGROUND    )
    {
        SetUserHanged(id)
        pev(id, pev_mins, g_fVecMins[id])
        pev(id, pev_maxs, g_fVecMaxs[id])
        pev(id, pev_origin, g_fVecOrigin[id])
    }
}


Unkolix 03-08-2013 11:01

Re: Walhang
 
Explain what should it do. What errors do you get?

layka_LUBII 03-08-2013 11:16

Re: Walhang
 
Plugin doesn't work please repair, because doesn't work Walhang thank you


All times are GMT -4. The time now is 21:47.

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