Raised This Month: $32 Target: $400
 8% 

Remaining CT = slay


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 12:55   Re: Remaining CT = slay
Reply With Quote #51

Quote:
Originally Posted by instinctpt1 View Post
@Bugsy can i ask you, why arent you checking this on DeathMsg event and get players count accordingly instead of adding a task to be executed every second ?
And why not use get_playersnum_ex ( http://www.amxmodx.org/api/amxmisc/get_playersnum_ex ) ?
1. I was doing that, but he then decided he wants the slay to only occur after X seconds have passed in a round. If I only check on death and the round seconds have not yet reached the desired seconds, the slay needs to be delayed until the seconds are reached. Using a task allows for this.

2. Because I code with the assumption not everyone is using 1.9.
__________________
Bugsy is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-25-2020 , 13:08   Re: Remaining CT = slay
Reply With Quote #52

But why not adding the deathevent check and check for delay in it?
I mean suppose last of remaining players other than the alive one from CT died, we should only then check for how many seconds have passed, if they are less than delay time, then set a task to check again just after delay time, if he is still alive then slay !
.
.
Or i interpreted it wrong ?
instinctpt1 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 13:20   Re: Remaining CT = slay
Reply With Quote #53

Suppose slay should only occur if 90 or more seconds have passed in the round.
Suppose all other conditions for HUD/slay are met at 5 seconds into the round.

I now need to trigger the HUD/slay in 85 seconds.

Options are:
- Begin the HUD/slay using a set_task() with an 85 second interval
- Keep checking conditions every 1 second and start HUD when all conditions are met.

Either way does the same thing, and I am doing the latter. There are obviously many ways to handle this.
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 13:40   Re: Remaining CT = slay
Reply With Quote #54

Here's what I think you are suggesting:
Spoiler
__________________

Last edited by Bugsy; 05-25-2020 at 13:41.
Bugsy is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 05-25-2020 , 15:06   Re: Remaining CT = slay
Reply With Quote #55

Exactly !
instinctpt1 is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-25-2020 , 17:39   Re: Remaining CT = slay
Reply With Quote #56

will be tested in 1 hour.
Stefanos is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-25-2020 , 18:53   Re: Remaining CT = slay
Reply With Quote #57

can you give me latest code, i got confused
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 18:55   Re: Remaining CT = slay
Reply With Quote #58

https://forums.alliedmods.net/showpo...1&postcount=49
__________________
Bugsy is offline
Stefanos
Senior Member
Join Date: May 2020
Old 05-25-2020 , 18:58   Re: Remaining CT = slay
Reply With Quote #59

before i upload that. My player reported me a new bug, he was last, countdown was up, he died before countdown, when new round started, he got slayed.
Stefanos is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2020 , 22:47   Re: Remaining CT = slay
Reply With Quote #60

Not sure, I don't think it's possible since the code shows HUD OR kills. Are you running anything else that would slay a player?
PHP Code:
    if ( --g_iSeconds >= 
    {
        
set_hudmessage170 255 , -1.0 0.40 0.0 1.0 0.0 0.0 , -);
        
ShowSyncHudMsgg_shHUD "%s will be slayed in %d second%s!" g_szName g_iSeconds g_iSeconds "s" "" );
    }
    else
    {
        
user_killid );
        
g_iSlayID 0;
        
g_szName] = EOS;
    } 
__________________

Last edited by Bugsy; 05-25-2020 at 22:48.
Bugsy 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 00:31.


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