AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   case problem (https://forums.alliedmods.net/showthread.php?t=205506)

manfailui 01-11-2013 10:15

case problem
 
if i want case 1 to case 10 = user_kill(id)
Can be written this
case 1:
{
user_kill(id)
}
case 2:
{
user_kill(id)
}
case 3 .....

but it is Inefficiency
teach me how to write better..thank you

AngeIII 01-11-2013 10:24

Re: case problem
 
PHP Code:

switch(id)
 {
     case 
1..10
    {
     
server_print("test");
    }
 } 


manfailui 01-11-2013 10:26

Re: case problem
 
Quote:

Originally Posted by AngeIII (Post 1871537)
PHP Code:

switch(id)
 {
     case 
1..10
    {
     
server_print("test");
    }
 } 


thank you:)


All times are GMT -4. The time now is 13:38.

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