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

Get Round how ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-17-2015 , 19:43   Get Round how ?
Reply With Quote #1

how i make for one menu is enabled every three rounds. Like i say!menu in one round, the menu only can be used again after 3 rounds.
thanks
Dkmuniz is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-17-2015 , 20:37   Re: Get Round how ?
Reply With Quote #2

Use a boolean variable to determine if the menu can be used or not (true initially; change it to false if it is used once). Then set a counter to 0, and increment the counter once per round. If the counter hits 3, set the boolean variable to true again.

(Something like that.)
Potato Uno is offline
klausenbusk
AlliedModders Donor
Join Date: Jan 2011
Old 01-17-2015 , 21:19   Re: Get Round how ?
Reply With Quote #3

Quote:
Originally Posted by Potato Uno View Post
Use a boolean variable to determine if the menu can be used or not (true initially; change it to false if it is used once). Then set a counter to 0, and increment the counter once per round. If the counter hits 3, set the boolean variable to true again.

(Something like that.)
Only a counter should be enough..
klausenbusk is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-18-2015 , 09:13   Re: Get Round how ?
Reply With Quote #4

I tried but not works !
PHP Code:
public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
if(
brounds == true)
    {
        new 
Rounds 0;
        
Rounds Rounds 1;
        if(
Rounds == 3)
        {
                  
Rounds 0;
              
brounds false;
        }
    }

PHP Code:
    if(brounds == true)
        {
            
CPrintToChat(client"\x07[ Brincadeiras ]\x07 \x0C Só podera dar bricadeiras a cada 3 rounds!");
            return 
Plugin_Continue;
        } 

Last edited by Dkmuniz; 01-18-2015 at 09:13.
Dkmuniz is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 01-18-2015 , 09:20   Re: Get Round how ?
Reply With Quote #5

Try this:

Counting of rounds

PHP Code:
new counts 0;

public 
OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast){
    
counts++;

Within the menu

PHP Code:
if(counts >= 3){
    
CPrintToChat(client"\x07[ Brincadeiras ]\x07 \x0C Só podera dar bricadeiras a cada 3 rounds!");
    return 
Plugin_Continue;

Simple and functional.

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM

Last edited by rodrigo286; 01-18-2015 at 09:22.
rodrigo286 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 01-18-2015 , 14:34   Re: Get Round how ?
Reply With Quote #6

That OnRoundStart isn't going to do anything until you add a HookEvent / HookEventEx to it. Depending on the game, the event in question will be round_start or teamplay_round_start.

If this is a TF2 plugin, you may need to check the full_reset event bool. It will be true if it was a real round change and false if it was moving to the next part of a multi-stage map.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-18-2015 , 14:46   Re: Get Round how ?
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
That OnRoundStart isn't going to do anything until you add a HookEvent / HookEventEx to it. Depending on the game, the event in question will be round_start or teamplay_round_start.

If this is a TF2 plugin, you may need to check the full_reset event bool. It will be true if it was a real round change and false if it was moving to the next part of a multi-stage map.
I know, i just put one part of code, now it works, thanks to Rodrigo !
Dkmuniz is offline
Dkmuniz
Senior Member
Join Date: Jun 2013
Old 01-18-2015 , 14:48   Re: Get Round how ?
Reply With Quote #8

Anyone can see my other thread please ?
https://forums.alliedmods.net/showthread.php?t=255169
Dkmuniz 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 04:05.


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