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

Fakedamage doesnt damage?


Post New Thread Reply   
 
Thread Tools Display Modes
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 06-26-2011 , 20:39   Re: Fakedamage doesnt damage?
Reply With Quote #11

Quote:
Originally Posted by Brian965 View Post


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <cstrike>
#include <fun>

stock update_scoreboard(idattrib 0)
{
    
// 0 == Nothing
    // 1 == DEAD
    // 2 == BOMB
    // 4 == VIP
    
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"));
    
write_byte(id);
    
write_byte(attrib);
    
message_end();
    
    return 
PLUGIN_HANDLED;
}

new const 
PLUGIN[] = "HideNSeek: Pain on Top";
new const 
VERSION[] = "1.0";

new 
Float:gfNextHurtTime[33];
new 
g_MaxPlayers;
new 
blood

public plugin_precache()
{
    
blood precache_model("sprites/blood.spr")
}

public 
plugin_init( )
{
    
register_pluginPLUGINVERSION"r4nDoMz" );
    
register_forward(FM_Touch"fwdTouch"0);

    
g_MaxPlayers global_get(glb_maxClients);
}

native hnsxp_get_user_xp(client);

native hnsxp_set_user_xp(clientxp);

stock hnsxp_add_user_xp(clientxp)
{
    return 
hnsxp_set_user_xp(clienthnsxp_get_user_xp(client) + xp);
}

public 
fwdTouch(idattacker)
{
    if( !
pev_valid(id) || !pev_valid(attacker)
    || !(
id <= g_MaxPlayers) || !(attacker <= g_MaxPlayers)
    || !
is_user_alive(id) || !is_user_alive(attacker) )
    {
        return 
FMRES_IGNORED;
    }

    if( 
cs_get_user_team(id) == cs_get_user_team(attacker) )
    {
        return 
FMRES_IGNORED;
    }
    
    new 
Float:vidOrigin[3], Float:vattackerOrigin[3];
    
pev(idpev_originvidOrigin);
    
pev(attackerpev_originvattackerOrigin);
    
    if( !(
49.0 < (vattackerOrigin[2] - vidOrigin[2]) < 73.0) )
    {
        return 
FMRES_IGNORED;
    }

    if (
halflife_time() >= gfNextHurtTime[attacker])
    {
        if (
get_user_health(id) > 10)
        {
            
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
            
write_byte(TE_BLOODSPRITE);
            
write_coord(vidOrigin[0]);
            
write_coord(vidOrigin[1]);
            
write_coord(vidOrigin[2]);
            
write_short(blood);
            
write_short(blood);
            
write_byte(229);
            
write_byte(12);
            
message_end();

            
fakedamage(id"player"5.0DMG_GENERIC);
        }
        else
        {
        new 
name1[42];
        new 
name2[42];
        static 
Float:fFrags;
        
get_user_name(attackername132);
        
get_user_name(idname232);
        
set_hudmessage(255255255, -1.0, -1.006.04.0);
        
show_hudmessage(0"%s just goomba stomped %s!"name1name2);
         
make_deathmsg(attacker,id,0,"goomba");
        
pev(idpev_fragsfFrags);
        
set_pev(idpev_fragsfFrags float(1));
        
fakedamage(id"Goomba Stomp"10000.0DMG_GENERIC);
        
        
hnsxp_add_user_xp(attacker50);
        
client_print(attacker,print_chat"***You got 50 XP for Goomba Stomping!***");
        
        for( new 
0g_MaxPlayersi++ )
         
update_scoreboard(i0);
     
        }
        
        
gfNextHurtTime[attacker] = halflife_time() + 0.5;
    }

    return 
FMRES_IGNORED;

lol brian. I love how you BEGGED me for this instead of searching
Twas already on the internet. Anyways. Why isnt it emitting blood? And how can i execute that code?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME

Last edited by r4ndomz; 06-26-2011 at 21:30.
r4ndomz is offline
Send a message via Skype™ to r4ndomz
FoxueR
Senior Member
Join Date: Jun 2011
Old 06-26-2011 , 22:01   Re: Fakedamage doesnt damage?
Reply With Quote #12

To get it to print that you were killed by a certain player, then assuming that you know the player will die to the damage, you have to block the next occurance of DeathMsg, run the fakedamage() call, then broadcast your own DeathMsg.

The blood is probably not showing up because of where you're standing. It's probably actually working, or with a minor tweak it would, but I suggest that you use TE_BLOODSTREAM instead:

PHP Code:
#define    TE_BLOODSTREAM              101      // Particle spray
// write_byte(TE_BLOODSTREAM)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_coord(vector.x)
// write_coord(vector.y)
// write_coord(vector.z)
// write_byte(color)
// write_byte(speed) 
__________________
¯\_(ツ)_/¯
FoxueR is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 06-27-2011 , 12:16   Re: Fakedamage doesnt damage?
Reply With Quote #13

Quote:
Originally Posted by FoxueR View Post
To get it to print that you were killed by a certain player, then assuming that you know the player will die to the damage, you have to block the next occurance of DeathMsg, run the fakedamage() call, then broadcast your own DeathMsg.

The blood is probably not showing up because of where you're standing. It's probably actually working, or with a minor tweak it would, but I suggest that you use TE_BLOODSTREAM instead:

PHP Code:
#define    TE_BLOODSTREAM              101      // Particle spray
// write_byte(TE_BLOODSTREAM)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
// write_coord(vector.x)
// write_coord(vector.y)
// write_coord(vector.z)
// write_byte(color)
// write_byte(speed) 
Thanks for the idea. Why arent these commands accurate? Fakedamage and Ham Takedamage are NEVER accurate, i want it to damage the player by 5 health, and it hurts them for 2 each time. I tried brians method, it works great, but i set the damage to 500, and it does 400. why?? How can i make it so it emits a headshot sound, with armor? The dink type noise, without using emit_sound?
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME

Last edited by r4ndomz; 06-27-2011 at 12:28.
r4ndomz is offline
Send a message via Skype™ to r4ndomz
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-27-2011 , 12:46   Re: Fakedamage doesnt damage?
Reply With Quote #14

Quote:
Originally Posted by r4ndomz View Post
Why arent these commands accurate? Fakedamage and Ham Takedamage are NEVER accurate, i want it to damage the player by 5 health, and it hurts them for 2 each time. I tried brians method, it works great, but i set the damage to 500, and it does 400. why??
Because you have to take armor into consideration.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 06-27-2011 , 13:18   Re: Fakedamage doesnt damage?
Reply With Quote #15

Ah thanks. How can i block only the deathmsg and the console message that says "player killed self with player"?

Why am i not getting any score when i kill someone this way? I used set_user_frags but i get nothing.
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME

Last edited by r4ndomz; 06-27-2011 at 13:27.
r4ndomz is offline
Send a message via Skype™ to r4ndomz
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 03:37.


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