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

Solved range shortcut question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tepegoz
Senior Member
Join Date: Apr 2019
Old 08-16-2020 , 11:26   range shortcut question
Reply With Quote #1

I have these codes:
PHP Code:
if(playerid == || playerid == || playerid == || playerid == || playerid == 5){
....

I want to shortcut theese codes. How to I do like this : if(playerid == (1,2,3,4,5)){ ?

Last edited by tepegoz; 08-16-2020 at 12:59.
tepegoz is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-16-2020 , 12:42   Re: range shortcut question
Reply With Quote #2

PHP Code:
if ( <= playerid <= )
{


if you wanted to maybe exclude 3. Read up on switch statements to see what else you can do.
PHP Code:
switch ( playerid )
{
    case 
1,2:
    {
    
    }
    case 
4,5:
    {
    
    }
    default:
    {
        
//anything other than 1,2,4,5
    
}

__________________
Bugsy is offline
tepegoz
Senior Member
Join Date: Apr 2019
Old 08-16-2020 , 12:59   Re: range shortcut question
Reply With Quote #3

thanks
tepegoz is offline
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 06:33.


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