Raised This Month: $203 Target: $400
 50% 

Get Round Number


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 05-08-2011 , 17:25   Get Round Number
Reply With Quote #1

HI all...Help me with plugin please.
I need get round nuber.
How I can do it ?
__________________
extreem is offline
Send a message via Skype™ to extreem
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 05-08-2011 , 17:34   Re: Get Round Number
Reply With Quote #2

You can use round / floor for that.
Clauu is offline
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 05-08-2011 , 17:40   Re: Get Round Number
Reply With Quote #3

How ? Can you tell me please ?
__________________
extreem is offline
Send a message via Skype™ to extreem
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-08-2011 , 17:53   Re: Get Round Number
Reply With Quote #4

You mean game round or rounding a float number ?

Rounding float number: floatround() function.

Game rounds: hook round start and game restart and increment/reset a global value accordingly... search for plugins that use such thing and see how they've done it.
__________________
Hunter-Digital is offline
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 05-08-2011 , 17:56   Re: Get Round Number
Reply With Quote #5

somevar = round(othervar) / somevar = floor(othervar) ?
Clauu is offline
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 05-08-2011 , 18:05   Re: Get Round Number
Reply With Quote #6

I don't understand it. I'm new in that.
I need only:
if round number == 5{
show_menu
}
__________________
extreem is offline
Send a message via Skype™ to extreem
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-08-2011 , 18:18   Re: Get Round Number
Reply With Quote #7

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new round_numberg_maxplayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0"// register round start
    
register_event("TextMsg""event_game_restart""a""2=#Game_Commencing""2=#Game_will_restart_in"// register game restart
    
    
g_maxplayers=get_maxplayers() // server slots
}

public 
event_round_start()
{
    
round_number++ // same as round_number = round_number+1
    
    
if (round_number==5)
    {
        for (new 
id=1;id<=g_maxplayers;id++)
        {
            if (!
is_user_connected(id)||is_user_bot(id))
                continue 
// don't try to show menu when there is no player in this server slot
                
            
show_menu(id0"^n"1// this actually removes all menus from player screen.
        
}
    }
}

public 
event_game_restart()
{
    
round_number=// don't forget to reset round counter

__________________


Last edited by SonicSonedit; 05-08-2011 at 21:26.
SonicSonedit is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-08-2011 , 19:16   Re: Get Round Number
Reply With Quote #8

PHP Code:
for (new id=0;id<=g_maxplayers;id++) 

PHP Code:
for (new id=1;id<=g_maxplayers;id++) 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-08-2011 , 21:27   Re: Get Round Number
Reply With Quote #9

Yep. Fixed.
__________________

SonicSonedit is offline
extreem
Member
Join Date: Apr 2011
Location: Czech Republick
Old 05-09-2011 , 08:59   Re: Get Round Number
Reply With Quote #10

Ou...Thanq very mutch
Sorry for bad English
__________________
extreem is offline
Send a message via Skype™ to extreem
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 07:28.


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