Raised This Month: $ Target: $400
 0% 

Solved How to achieve cumulative effect on death pool?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
damage220
Senior Member
Join Date: Jul 2022
Location: Ukraine
Old 12-02-2022 , 15:45   Re: How to achieve cumulative effect on death pool?
Reply With Quote #1

Quote:
Originally Posted by Natsheh View Post
You can create a player global variable and store in it the current gametime when the player dies/killed, and update the players kills after one or two seconds passed from the last kill.

PHP Code:
new Float:g_fLastKillTime[33], g_UserComboFrags[33];

// HOOKED via ham sandwich module.
public fwPlayerKilledPost( const vId, const kId, const bool:shouldgib )
{
   if(!
is_user_connected(kId)) return;
   
g_fLastKillTime[kId] = get_gametime();
   
g_UserComboFrags[kId] ++;

   
set_task(1.25"UpdatePlayer"kId);
}

public 
UpdatePlayer(id)
{
   if( ( 
get_gametime() - g_fLastKillTime[id] ) >= 1.0 )
   {
       
// do your stuff...
   
}

I could but I do not like delayed response. I am pretty happy with the solution I posted above.
damage220 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 15:38.


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