Raised This Month: $12 Target: $400
 3% 

Rafraichir les frags


  
 
 
Thread Tools Display Modes
Author Message
eVerup
Veteran Member
Join Date: Jul 2009
Location: N'importe Ou ...
Old 05-23-2012 , 16:02   Rafraichir les frags
#1

Bonjour a tous,

un probleme tout con se pose, quand on fait un set_user_frags et qu'on lui met un frag de plus , les frags se s'actualisent pas avant un nouveau round ou un réel kill , comment le rafrachir le plus facilement possible ?

Merci.
eVerup is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-23-2012 , 16:11   Re: Rafraichir les frags
#2

Ham_AddPoints

Qui appelle ensuite cette fonction ::

Code:
void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore )
{
	// Positive score always adds
	if ( score < 0 )
	{
		if ( !bAllowNegativeScore )
		{
			if ( pev->frags < 0 )		// Can't go more negative
				return;
			
			if ( -score > pev->frags )	// Will this go negative?
			{
				score = -pev->frags;		// Sum will be 0
			}
		}
	}

	pev->frags += score;

	MESSAGE_BEGIN( MSG_ALL, gmsgScoreInfo );
		WRITE_BYTE( ENTINDEX(edict()) );
		WRITE_SHORT( pev->frags );
		WRITE_SHORT( m_iDeaths );
		WRITE_SHORT( 0 );
		WRITE_SHORT( g_pGameRules->GetTeamIndex( m_szTeamName ) + 1 );
	MESSAGE_END();
}

Donc pour cs :

PHP Code:
#define m_iDeaths 444 
Et les fonctions : (celle qui t'intéresse : SetUserFrags(id, frags)

PHP Code:
SetUserFrags(idfrags)
{
    
ExecuteHam(Ham_AddPointsidfrags get_user_frags(id), true)
}

SetUserDeaths(iddeaths)
{
    
set_pdata_int(idm_iDeathsdeaths)
    
ExecuteHam(Ham_AddPointsid0true)
}

SetUserScore(idfragsdeaths)
{
    
set_pdata_int(idm_iDeathsdeaths)
    
ExecuteHam(Ham_AddPointsidfrags get_user_frags(id), true)
}

AddUserFrags(idfrags)
{
    
ExecuteHam(Ham_AddPointsidfragstrue)
}

AddUserDeaths(iddeaths)
{
    
set_pdata_int(idm_iDeathsgt_pdata_int(idm_iDeaths) + deaths)
    
ExecuteHam(Ham_AddPointsid0true)

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-23-2012 at 18:59.
ConnorMcLeod is offline
eVerup
Veteran Member
Join Date: Jul 2009
Location: N'importe Ou ...
Old 05-24-2012 , 12:30   Re: Rafraichir les frags
#3

PARFAIS ! Merci beaucoup connor
eVerup is offline
 



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 17:50.


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