Raised This Month: $ Target: $400
 0% 

Fakedamage doesnt damage?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 06-25-2011 , 15:38   Re: Fakedamage doesnt damage?
Reply With Quote #7

Yes fysiks, it is being executed. I thought i said it wasnt damaging. It IS in fact making noise and emitting blood. So it must be executing. Hunter-Digital, what would a players classname be? ERox, of course i have..thats quite obvious i would have to do that. Most of my errors i have solved myself before checking back at this thread, but it still isnt damaging unless i set the players health -5

Quote:
and btw as said many many times don't copy paste -.-
there is no way im wasting my time typing when i can copy and paste

Yes, i am trying to recreate igz's damage on top thing
full code:
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);
}

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) > 0)
        {
            
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
        {
            
set_user_frags(attackerget_user_frags(attacker) + 1);
            
cs_set_user_deaths(idcs_get_user_deaths(id) + 1);

            
make_deathmsg(attackerid0"worldspawn");
            for( new 
0g_MaxPlayersi++ )
            {
                
update_scoreboard(i0);
            }
        }
        
        
gfNextHurtTime[attacker] = halflife_time() + 0.5;
    }

    return 
FMRES_IGNORED;

Everything works perfectly. I just dont get damaged when im stepped on

Edit: of course. I somehow fixed it. I think it was exolents post that did it. But i have a new problem, it doesnt emit the blood anymore, and when i die from being stepped on it says i killed myself instead of the player whos stepping on me. How can i fix that? Oh and im pretty sure the else code from get_user_health > 0 isnt being called. How do i get it to call without constantly giving score? I get warning about vidOrigin from the blood message also.
__________________
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-25-2011 at 16:19.
r4ndomz is offline
Send a message via Skype™ to r4ndomz
 



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 23:27.


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