Raised This Month: $ Target: $400
 0% 

Solved Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by (-1)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 01-16-2017 , 20:16   Re: Ham_TakeDamage Weird Bug | get_user_surfing | Semiclip | Read File | find_ent_by
Reply With Quote #10

1. About the damage event, try it

PHP Code:
public Event_Damage(id
{
    static 
iAttackeriAttacker get_user_attacker(id)
    static 
iDamageiDamage read_data(2)
    
    
set_dhudmessage(random_num(50,255), random_num(50,255), random_num(50,255), random_float(0.200.60), random_float(0.200.60), 06.00.5)
    
show_dhudmessage(iAttacker"Damage given: %d"damage)
    

About the Ham_TakeDamage, I've tested here without your arrays and it works, I think what OciXCrom is correct. And you can do your code like this, looks more fine

PHP Code:
public fw_HamTakeDamage(victiminflictorattackerFloat:damagedamagebit
{
    if(!
is_user_alive(victim) || !is_user_alive(attacker))
        return 
HAM_IGNORED
        
    
if(!victim || !attacker)
        return 
HAM_IGNORED

    
switch(damagebit)
    {
        case 
DMG_FALL
        {
            
SetHamReturnInteger(0)
            return 
HAM_SUPERCEDE
        
}
        case 
DMG_GRENADE:
        {
            if(
attacker == victim)
            {
                
SetHamReturnInteger(0)
                return 
HAM_SUPERCEDE
            
}
        }
        default: 
// Idk if it is correct
        
{
            new 
iWeapon get_user_weapon(attacker)
            switch(
iWeapon)
            {
                case 
CSW_DEAGLE:
                {
                    if(
deagle_used[attacker]) 
                    {
                        
SetHamParamFloat(4damage 999.0)
                        
client_print(attackerprint_chat"It Works !!")
                    }
                }
                case 
CSW_AK47:
                {
                    if(
ak47_used[attacker]) 
                    {
                        
SetHamParamFloat(4damage 999.0)
                        
client_print(attackerprint_chat"It Works !!")
                    }
                }    
            }
        }
    }
    return 
HAM_IGNORED

2. I think not
3. About the Semiclip, this is the version i'm using

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

new const VERSION[] = "0.7.0"

const MAX_PLAYERS 32

new g_iPlayers[MAX_PLAYERS], g_iNumg_iPlayeri
new const g_szAliveFlags[] = "a"
#define RefreshPlayersList()    get_players(g_iPlayers, g_iNum, g_szAliveFlags)

public plugin_init()
{
    
register_plugin("Semiclip"VERSION"ConnorMcLeod")

    
register_forward(FM_AddToFullPack"FM_client_AddToFullPack_Post"1)

    
RegisterHam(Ham_Player_PreThink"player""Ham_CBasePlayer_PreThink_Post"1)
}

public 
FM_client_AddToFullPack_Post(eseiEntidhostflagsplayerpSet)
{
    if( 
player && id != iEnt && get_orig_retval() && is_user_alive(id) )
    {
        
set_es(esES_SolidSOLID_NOT)
    }
}

public 
Ham_CBasePlayer_PreThink_Post(id)
{
    if( !
is_user_alive(id) )
    {
        return
    }

    
RefreshPlayersList()

    for(
0i<g_iNumi++)
    {
        
g_iPlayer g_iPlayers[i]
        if( 
id != g_iPlayer && get_user_team(id) == get_user_team(g_iPlayer))
        {
            
set_pev(g_iPlayerpev_solidSOLID_NOT)
        }
    }
}

public 
client_PostThink(id)
{
    if( !
is_user_alive(id) )
    {
        return
    }

    
RefreshPlayersList()

    for(
0i<g_iNumi++)
    {
        
g_iPlayer g_iPlayers[i]
        if( 
g_iPlayer != id && get_user_team(id) == get_user_team(g_iPlayer))
        {
            
set_pev(g_iPlayerpev_solidSOLID_SLIDEBOX)
        }
    }

4. https://forums.alliedmods.net/showpo...93&postcount=5 - I think is that what you're searching
5. https://wiki.alliedmods.net/Finding_...es_(amx_mod_x)
6. This? https://forums.alliedmods.net/showpo...80&postcount=5
May be this? https://forums.alliedmods.net/showpo...2&postcount=14
Or this https://forums.alliedmods.net/showthread.php?t=123684
If all those links doesn't work for you - https://forums.alliedmods.net/showpo...7&postcount=10
Ah, another one - https://forums.alliedmods.net/showpo...60&postcount=8
Ops, another - https://forums.alliedmods.net/showpo...2&postcount=52
LOL, I found another - https://forums.alliedmods.net/showth...=123684&page=6

Ok, I'll stop it
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 01-16-2017 at 20:45.
EFFx is offline
 



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 20:59.


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