Raised This Month: $ Target: $400
 0% 

CHalfLifeMultiplay::DeathNotice(PlayerKilled) crash


Post New Thread Reply   
 
Thread Tools Display Modes
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 02-21-2016 , 18:10   Re: CHalfLifeMultiplay::DeathNotice(PlayerKilled) crash
Reply With Quote #11

Next problem with this stock...
When I use:
PHP Code:
RegisterHamPlayer(Ham_TakeDamage"BlockTakeDamage");
RegisterHamPlayer(Ham_TraceAttack"BlockTraceAttack");

public 
BlockTakeDamage(idiEntattacker) return vBlockTakeDamage(idattacker);
public 
BlockTraceAttack(idattacker) return vBlockTakeDamage(idattacker);

vBlockTakeDamage(idattacker) {
    if(!
userValid(id) || !userValid(attacker) || userTeam(id) != 1) return 1;

    if(
userTeam(attacker) == || GetUserWeapon(attacker) != CSW_SCOUT) return 4;
    if(
userTeam(attacker) == 1) {
        
UserKill(id_attacker__2DMG_BULLET|DMG_ALWAYSGIBfalsetrue);
        return 
4;
    }
    return 
1;

Everything works fine, but weapon name is incorrect
log:
Code:
"AmNezia<712><XXX><TERRORIST>" killed "Gruby RPK<686><XXX><TERRORIST>" with "world"
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-21-2016 , 18:26   Re: CHalfLifeMultiplay::DeathNotice(PlayerKilled) crash
Reply With Quote #12

The answer is the same. You don't set inflictor as it should. So now the killer is a player, you enter the condition and you get no crash (#3) but since inflictor is null, by default, you will get "world".
__________________
Arkshine is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 02-21-2016 , 18:51   Re: CHalfLifeMultiplay::DeathNotice(PlayerKilled) crash
Reply With Quote #13

So how I should properly set a inflictor?
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-22-2016 , 04:24   Re: CHalfLifeMultiplay::DeathNotice(PlayerKilled) crash
Reply With Quote #14

I've already answered that.

Quote:
You should probably call TakeDamage instead with some damage > player's current health.
or you have to set manually g_pevLastInflictor (orpheu, okapi, etc.) like #6.

or you have to hook PlayerKilled (or DeathNotice) manually and passing a valid inflictor.
__________________

Last edited by Arkshine; 02-23-2016 at 07:01.
Arkshine is offline
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 09:55.


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