Raised This Month: $ Target: $400
 0% 

how random function from switch ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
login_xcvop
Member
Join Date: Nov 2013
Old 01-27-2014 , 10:49   how random function from switch ?
Reply With Quote #1

PHP Code:
        switch(get_pcvar_num(cvar_function))
        {
            case 
1:
            {
                function
            }
            case 
2:
            {
                function
            }
            case 
3:
            {
                function
            }
            case 
4:
            {
                function
            }
            case 
5:
            {
                
random_num(get_pcvar_num(cvar_function), 4-1)
            }
        } 

Last edited by login_xcvop; 01-27-2014 at 10:50.
login_xcvop is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-27-2014 , 10:49   Re: how random function from swith ?
Reply With Quote #2

What are you trying to do?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
login_xcvop
Member
Join Date: Nov 2013
Old 01-27-2014 , 10:51   Re: how random function from switch ?
Reply With Quote #3

make random is cvar volue 5

Last edited by login_xcvop; 01-27-2014 at 10:52.
login_xcvop is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-27-2014 , 10:56   Re: how random function from switch ?
Reply With Quote #4

You will either need to determine that before the switch or add another switch within case 5
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
login_xcvop
Member
Join Date: Nov 2013
Old 01-27-2014 , 11:03   Re: how random function from switch ?
Reply With Quote #5

how set ? sorry can't understand all, bad english
login_xcvop is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-27-2014 , 11:08   Re: how random function from switch ?
Reply With Quote #6

This maybe???????????

PHP Code:
switch(get_pcvar_num(g_pCvar))
{
  case 
1: return;

  case 
2: return;

  case 
3: return;

  case 
4: return;

  default: 
set_pcvar_num(g_pCvar,random(1,4));

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-27-2014 , 11:09   Re: how random function from switch ?
Reply With Quote #7

Code:
new var = get_pcvar_num(cvar_function);
if (var >= 5)
    var = random_num(1,4);

switch(var)
{
    case 1:
    {
        function
    }
    case 2:
    {
        function
    }
    case 3:
    {
        function
    }
    case 4:
    {
        function
    }
}
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 01-27-2014 at 11:16.
YamiKaitou is offline
login_xcvop
Member
Join Date: Nov 2013
Old 01-27-2014 , 11:18   Re: how random function from switch ?
Reply With Quote #8

works ! thank you

Quote:
Originally Posted by YamiKaitou View Post
Code:
new var = get_pcvar_num(cvar_function);
if (var >= 5)
    var = random_num(1,4);

switch(var)
{
    case 1:
    {
        function
    }
    case 2:
    {
        function
    }
    case 3:
    {
        function
    }
    case 4:
    {
        function
    }
}

Last edited by login_xcvop; 01-27-2014 at 11:19.
login_xcvop is offline
login_xcvop
Member
Join Date: Nov 2013
Old 01-27-2014 , 11:10   Re: how random function from switch ?
Reply With Quote #9

i don't think
login_xcvop is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-27-2014 , 11:15   Re: how random function from switch ?
Reply With Quote #10

Quote:
Originally Posted by login_xcvop View Post
i don't think
You do not think what? Explain better
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 10:08.


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