Raised This Month: $282 Target: $400
 70% 

Fixed Error Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lantimilan
Senior Member
Join Date: May 2016
Location: KOSOVA
Old 12-03-2020 , 09:02   Fixed Error Help
Reply With Quote #1

Hello i have this error in logs who can help me to fixed :
PHP Code:
L 12/02/2020 18:34:49: [AMXXDisplaying debug trace (plugin "no-dmg.amxx"version "1.1")
L 12/02/2020 18:34:49: [AMXXRun time error 10native error (native "get_user_weapon")
L 12/02/2020 18:34:49: [AMXX]    [0no-dmg.sma::fwdHamBlockAwpPre (line 52)
L 12/02/2020 18:35:55Invalid player id 0
L 12
/02/2020 18:35:55: [AMXXDisplaying debug trace (plugin "no-dmg.amxx"version "1.1")
L 12/02/2020 18:35:55: [AMXXRun time error 10native error (native "get_user_weapon")
L 12/02/2020 18:35:55: [AMXX]    [0no-dmg.sma::fwdHamBlockAwpPre (line 52
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define BLOCK_TYPE 0
/*
    0 - Блочит урон, но есть кровь. Легкий вариант.
    1 - Блочит урон и кровь при попадании. Тяжелее 1-го способа.
*/

new Trie:g_tAuthIds;
new 
bool:g_bBlockKill[33];

public 
plugin_init()
{
    
register_plugin("No Dmg AWP""1.1""neyogomon");
#if BLOCK_TYPE == 0
    
RegisterHam(Ham_TakeDamage"player""fwdHamBlockAwpPre"false);
#endif
#if BLOCK_TYPE == 1
    
RegisterHam(Ham_TraceAttack"player""fwdHamBlockAwpPre"false);
#endif    
}

public 
plugin_cfg()
{
    new 
fp fopen("addons/amxmodx/configs/nodmg.ini""rt");
    if(!
fpset_fail_state("File ^"addons/amxmodx/configs/nodmg.ini^" nuk u gjet ose nuk u lexu!");
    
g_tAuthIds TrieCreate();
    new 
buff[25];
    while(!
feof(fp))
    {
        
fgets(fpbuffcharsmax(buff));
        
trim(buff);
        if(!
buff[0] || buff[0] == ';') continue;
        
TrieSetCell(g_tAuthIdsbuff0);
    }
    
fclose(fp);
}

public 
client_putinserver(id)
{
    static 
sAuthId[25]; get_user_authid(idsAuthIdcharsmax(sAuthId));
    
g_bBlockKill[id] = TrieKeyExists(g_tAuthIdssAuthId) ? true false;
}

#if BLOCK_TYPE == 0
public fwdHamBlockAwpPre(pVictimIdInflictorpAttacker)
#endif
#if BLOCK_TYPE == 1
public fwdHamBlockAwpPre(pVictimpAttacker)
#endif
    
return (g_bBlockKill[pVictim] && get_user_weapon(pAttacker) == CSW_AWP) ? HAM_SUPERCEDE HAM_IGNORED;

public 
plugin_end() TrieDestroy(g_tAuthIds); 

Last edited by lantimilan; 12-03-2020 at 09:05.
lantimilan is offline
Send a message via MSN to lantimilan
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-03-2020 , 23:48   Re: Fixed Error Help
Reply With Quote #2

Add a check to see if the attacker is connected: is_user_connected(pAttacker). If the attacker is not connected return HAM_IGNORED. Put this check before the current return line.
__________________
fysiks is offline
lantimilan
Senior Member
Join Date: May 2016
Location: KOSOVA
Old 12-11-2020 , 01:33   Re: Fixed Error Help
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Add a check to see if the attacker is connected: is_user_connected(pAttacker). If the attacker is not connected return HAM_IGNORED. Put this check before the current return line.
How to make this, if you can help me ?
lantimilan is offline
Send a message via MSN to lantimilan
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-12-2020 , 03:23   Re: Fixed Error Help
Reply With Quote #4

Here ya go:

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

#define BLOCK_TYPE 0
/*
    0 - Блочит урон, но есть кровь. Легкий вариант.
    1 - Блочит урон и кровь при попадании. Тяжелее 1-го способа.
*/

new Trie:g_tAuthIds;
new 
bool:g_bBlockKill[33];

public 
plugin_init()
{
    
register_plugin("No Dmg AWP""1.1""neyogomon");
#if BLOCK_TYPE == 0
    
RegisterHam(Ham_TakeDamage"player""fwdHamBlockAwpPre"false);
#endif
#if BLOCK_TYPE == 1
    
RegisterHam(Ham_TraceAttack"player""fwdHamBlockAwpPre"false);
#endif
}

public 
plugin_cfg()
{
    new 
fp fopen("addons/amxmodx/configs/nodmg.ini""rt");
    if(!
fpset_fail_state("File ^"addons/amxmodx/configs/nodmg.ini^" nuk u gjet ose nuk u lexu!");
    
g_tAuthIds TrieCreate();
    new 
buff[25];
    while(!
feof(fp))
    {
        
fgets(fpbuffcharsmax(buff));
        
trim(buff);
        if(!
buff[0] || buff[0] == ';') continue;
        
TrieSetCell(g_tAuthIdsbuff0);
    }
    
fclose(fp);
}

public 
client_putinserver(id)
{
    static 
sAuthId[25]; get_user_authid(idsAuthIdcharsmax(sAuthId));
    
g_bBlockKill[id] = TrieKeyExists(g_tAuthIdssAuthId) ? true false;
}

#if BLOCK_TYPE == 0
public fwdHamBlockAwpPre(pVictimIdInflictorpAttacker)
#endif
#if BLOCK_TYPE == 1
public fwdHamBlockAwpPre(pVictimpAttacker)
#endif
{
    if( !
is_user_connected(pAttacker) )
        return 
HAM_IGNORED
    
return (g_bBlockKill[pVictim] && get_user_weapon(pAttacker) == CSW_AWP) ? HAM_SUPERCEDE HAM_IGNORED;
}

public 
plugin_end()
{
    
TrieDestroy(g_tAuthIds);

__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 12:43.


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