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

[solved] Clcmd after 2 rounds


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-06-2016 , 07:21   Re: [solved] Clcmd after 2 rounds
Reply With Quote #11

And another thought i have, this one:
PHP Code:
   switch(g_iRounds)
        {
            case 
1client_print(id,print_chat,"you have to wait 2 rounds");
             case 
2client_print(id,print_chat,"you have to wait 1 rounds");
         } 
Not should be like this?

PHP Code:
   switch(g_iRounds)
        {
            case 
0client_print(id,print_chat,"you have to wait 2 rounds");
            case 
1client_print(id,print_chat,"you have to wait 1 rounds");
        } 
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-06-2016 , 07:31   Re: [solved] Clcmd after 2 rounds
Reply With Quote #12

Quote:
Originally Posted by Craxor View Post
And another thought i have, this one:
PHP Code:
   switch(g_iRounds)
        {
            case 
1client_print(id,print_chat,"you have to wait 2 rounds");
             case 
2client_print(id,print_chat,"you have to wait 1 rounds");
         } 
Not should be like this?

PHP Code:
   switch(g_iRounds)
        {
            case 
0client_print(id,print_chat,"you have to wait 2 rounds");
            case 
1client_print(id,print_chat,"you have to wait 1 rounds");
        } 
No
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-06-2016 , 08:45   Re: [solved] Clcmd after 2 rounds
Reply With Quote #13

if he se my code variant should be like that, because he will have a round when he will have g_iRounds with 0, so should be like that or maybe an another third case will be required, if he use you variant it's ok as it is.

I'm not correct? ( p.s.: don't quote my whole reply)
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-06-2016 , 09:34   Re: [solved] Clcmd after 2 rounds
Reply With Quote #14

Quote:
Originally Posted by Craxor View Post
if he se my code variant should be like that, because he will have a round when he will have g_iRounds with 0, so should be like that or maybe an another third case will be required, if he use you variant it's ok as it is.

I'm not correct? ( p.s.: don't quote my whole reply)
You're switching g_iRounds. It's the same like doing this

PHP Code:
if(g_iRounds == 1) {
    
// case 1
}

if(
g_iRounds == 2) {
    
// case 2

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 09-06-2016 , 11:31   Re: [solved] Clcmd after 2 rounds
Reply With Quote #15

@Napoleon_be and @Craxor
Thanks both of you it worked in my local hlds let see what happened in main server when players more than 10+
i will give you feedback later (Y)
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-06-2016 , 12:54   Re: [solved] Clcmd after 2 rounds
Reply With Quote #16

Quote:
Originally Posted by Napoleon_be View Post
You're switching g_iRounds. It's the same like doing this

PHP Code:
if(g_iRounds == 1) {
    
// case 1
}

if(
g_iRounds == 2) {
    
// case 2

PHP Code:
if(g_iRounds == 1) {
    
// case 1
}

else if(
g_iRounds == 2) {
    
// case 2

need to use else if
Freezo Begin is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-06-2016 , 15:26   Re: [solved] Clcmd after 2 rounds
Reply With Quote #17

@NapoleanBe I'm talking that is a difference because i'm increasing the variable g_iRounds differently, with an else, so i should have a round with 0, if users write /test and g_iRounds will be 0 will need a case with this value


Indaraj - we waiting for you answer.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-07-2016 , 03:14   Re: [solved] Clcmd after 2 rounds
Reply With Quote #18

Quote:
Originally Posted by Craxor View Post
@NapoleanBe I'm talking that is a difference because i'm increasing the variable g_iRounds differently, with an else, so i should have a round with 0, if users write /test and g_iRounds will be 0 will need a case with this value


Indaraj - we waiting for you answer.
Ofcourse, but you can't set a message that outputs round 1 at case 0.

@Freezo, there's totally no else needed for that lol.
__________________

Last edited by Napoleon_be; 09-07-2016 at 03:14.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 09-07-2016 , 04:59   Re: [solved] Clcmd after 2 rounds
Reply With Quote #19

Quote:
Originally Posted by Craxor View Post
@NapoleanBe I'm talking that is a difference because i'm increasing the variable g_iRounds differently, with an else, so i should have a round with 0, if users write /test and g_iRounds will be 0 will need a case with this value


Indaraj - we waiting for you answer.
if you are talking about this yes you can if user say in round 0 then case 0 will be
PHP Code:
case client_print(id,print_chat,"you have already used in this round");
case 
client_print(id,print_chat,"you have to wait 2 rounds")
etc 
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 09-07-2016 at 08:39.
indraraj striker is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-07-2016 , 06:41   Re: [solved] Clcmd after 2 rounds
Reply With Quote #20

Quote:
Originally Posted by indraraj striker View Post
if you are talking about this yes you can if user say in round 0 then case 0 will be
PHP Code:
case client_print(id,print_chat,"you have already used in this round");
case 
client_print(id,print_chat,"you have to wait 1 rounds")
etc 
Quote:
Originally Posted by Craxor View Post
And another thought i have, this one:
PHP Code:
   switch(g_iRounds)
        {
            case 
1client_print(id,print_chat,"you have to wait 2 rounds");
             case 
2client_print(id,print_chat,"you have to wait 1 rounds");
         } 
Not should be like this?

PHP Code:
   switch(g_iRounds)
        {
            case 
0client_print(id,print_chat,"you have to wait 2 rounds");
            case 
1client_print(id,print_chat,"you have to wait 1 rounds");
        } 

Indeed, but this isn't correct.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 06:56.


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