Raised This Month: $ Target: $400
 0% 

Rounds left


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Artifact
Veteran Member
Join Date: Jul 2010
Old 08-28-2012 , 03:03   Rounds left
Reply With Quote #1

How can I catch how much rounds left?
__________________
Artifact is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-28-2012 , 03:55   Re: Rounds left
Reply With Quote #2

PHP Code:
new g_iRoundsCount 0;

GetRoundsLeft( )
  return 
get_cvar_num"mp_maxrounds" ) > ? ( get_cvar_num"mp_maxrounds" ) - g_iRoundsCount ) : -1;

public 
plugin_init( )
  
register_logevent"RoundEnd"2"1=Round_End" );

public 
client_connectiPlayer ) {
  static 
iRoundsLeft;
  
iRoundsLeft GetRoundsLeft( );

  if( 
iRoundsLeft != -&& iRoundsLeft <= ) {
    
//...
  
}
}

public 
RoundEnd( )
  
g_iRoundsCount++; 
I can't make sure if Game Commencing may do this function stop working.
__________________

Last edited by claudiuhks; 08-28-2012 at 03:58.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Artifact
Veteran Member
Join Date: Jul 2010
Old 08-28-2012 , 05:14   Re: Rounds left
Reply With Quote #3

What mean ? character in
PHP Code:
  return get_cvar_num"mp_maxrounds" ) > ? ( get_cvar_num"mp_maxrounds" ) - g_iRoundsCount ) : -1
__________________

Last edited by Artifact; 08-28-2012 at 05:14.
Artifact is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-28-2012 , 07:00   Re: Rounds left
Reply With Quote #4

Quote:
Originally Posted by Artifact View Post
What mean ? character in
PHP Code:
  return get_cvar_num"mp_maxrounds" ) > ? ( get_cvar_num"mp_maxrounds" ) - g_iRoundsCount ) : -1
Code:
return get_cvar_num( "mp_maxrounds" ) > 0 ? ( get_cvar_num( "mp_maxrounds" ) - g_iRoundsCount ) : -1;
is equal to
Code:
if( get_cvar_num( "mp_maxrounds" ) > 0 )         return ( get_cvar_num( "mp_maxrounds" ) - g_iRoundsCount ); return -1;
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Artifact
Veteran Member
Join Date: Jul 2010
Old 08-28-2012 , 07:34   Re: Rounds left
Reply With Quote #5

Aha oke Thanks
__________________
Artifact 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 05:42.


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