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(id, attrib = 0)
{
// 0 == Nothing
// 1 == DEAD
// 2 == BOMB
// 4 == VIP
message_begin(MSG_ALL, get_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_plugin( PLUGIN, VERSION, "r4nDoMz" );
register_forward(FM_Touch, "fwdTouch", 0);
g_MaxPlayers = global_get(glb_maxClients);
}
public fwdTouch(id, attacker)
{
if( !pev_valid(id) || !pev_valid(attacker)
|| !(0 < id <= g_MaxPlayers) || !(0 < 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(id, pev_origin, vidOrigin);
pev(attacker, pev_origin, vattackerOrigin);
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_BROADCAST, SVC_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.0, DMG_GENERIC);
}
else
{
set_user_frags(attacker, get_user_frags(attacker) + 1);
cs_set_user_deaths(id, cs_get_user_deaths(id) + 1);
make_deathmsg(attacker, id, 0, "worldspawn");
for( new i = 0; i < g_MaxPlayers; i++ )
{
update_scoreboard(i, 0);
}
}
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.
__________________