Raised This Month: $ Target: $400
 0% 

Reliable channel overflowe


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-25-2011 , 06:18   Reliable channel overflowe
Reply With Quote #1

hi,

idk why my user will not be respawned and will be kicked because of channel overflowe.

PHP Code:
RegisterHam(Ham_TakeDamage"player""hook_TakeDamage");

public 
hook_TakeDamage(thisidinflictoridattackerFloat:damagedamagebits)
{

if(
idattacker == || is_user_connected(idattacker))
        {
            return 
HAM_SUPERCEDE;
        }
        else
        {
            if(
checkAutoRespawn(thisdamage))
            {
                return 
HAM_SUPERCEDE;
            }
        }
}

stock checkAutoRespawn(thisFloat:damage)
{
    
    if(
get_pcvar_num(sv_autorespawn))
    {
        
health[this] -= damage;
        if(
health[this] < 1.0)
        {
            
set_pev(thispev_health0.0);
            
set_pev(thispev_deadflagDEAD_RESPAWNABLE);
            
            
dllfunc(DLLFunc_Spawnthis);
            return 
1;
        }
    }
    return 
0;

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-25-2011 , 07:16   Re: Reliable channel overflowe
Reply With Quote #2

Why hooking TakeDamage and not Killed ?
__________________
Arkshine is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-25-2011 , 07:26   Re: Reliable channel overflowe
Reply With Quote #3

because i dont want that user dies.
i want to respawn user before he dies.
and point 2 is because the user can be stucked :-(

oh and user can fall. in this case he will be respawned again. something like surf
__________________

Last edited by One; 04-25-2011 at 07:32.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-25-2011 , 07:37   Re: Reliable channel overflowe
Reply With Quote #4

One
Quote:
because i dont want that user dies.
Use return HAM_IGNORED instead return HAM_SUPERCEDE when you don't need to block function, use ExecuteHamB(Ham_CS_RoundRespawn, id) instead of dllfunc(DLLFunc_Spawn, this) and don't use set_pev(this, pev_health, 0.0) and set_pev(this, pev_deadflag, DEAD_RESPAWNABLE) since player didn't die. Setting health to 0 will do nothing (except causing client-side bugs and errors in poor-coded plugins that check health to know if user alive) and setting respawnable flag to alive entity is a bad idea.
__________________


Last edited by SonicSonedit; 04-25-2011 at 07:41.
SonicSonedit is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-25-2011 , 07:41   Re: Reliable channel overflowe
Reply With Quote #5

Code:
RegisterHam( Ham_Killed, "player", "FwdHamPlayerKilled", 1 ); public FwdHamPlayerKilled( const id ) {     entity_set_int( id, EV_INT_deadflag, DEAD_RESPAWNABLE ); }

works fine
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-25-2011 , 07:47   Re: Reliable channel overflowe
Reply With Quote #6

ok thanks but what about when user falls & got for example only 10 dmg?
i dont think this can be catched by Ham_Killed.
so i have to use takedamge anyways.
but i will test to clean the code for first. i hope this works.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-25-2011 , 07:52   Re: Reliable channel overflowe
Reply With Quote #7

One
Ham_Killed registers any death.
Quote:
because i dont want that user dies.
i want to respawn user before he dies.
Decide what you need: respawn player AFTER he died or make it look like player respawned right BEFORE he died.
__________________

SonicSonedit is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-29-2011 , 08:16   Re: Reliable channel overflowe
Reply With Quote #8

Quote:
Originally Posted by SonicSonedit View Post
One
Ham_Killed registers any death.

Decide what you need: respawn player AFTER he died or make it look like player respawned right BEFORE he died.
nope its not the same.

i tried it and its not what i want.

for sure i can block death msg & fix the scores but its not the same.
before player be respawned he willbe killed!

i tried to return it that my user willnot be killed but its not working :-(
Attached Thumbnails
Click image for larger version

Name:	dr.jpg
Views:	204
Size:	97.7 KB
ID:	85376  
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 20:08.


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