Using a switch
#1

Hello, im wondering if you could use a switch for something like IsPlayerInVehicle, or IsPlayerInDynamicArea (from Incognito's streamer)
Here's a code of what i mean with IsPlayerInDynamicArea:
pawn Код:
if(IsPlayerInDynamicArea(i, LosSantos))
{
    // Codes
}
else if(IsPlayerInDynamicArea(i, SanFierro))
{
    // Codes
}
else if(IsPlayerInDynamicArea(i, LasVenturas))
{
    // Codes
}
As you can see, im using "if"'s to check each of these, and i think it would be much quicker using a switch, but im not sure how, for checking different areas?

This doesn't work, but just an example if you still don't understand.
pawn Код:
switch(IsPlayerInDynamicArea(i))
{
    case LosSantos:
    {
        // Codes
    }
    case SanFierro:
    {
        // Codes
    }
    case LasVenturas:
    {
        // Codes
    }
}
This would kinda be what i want.
Reply


Messages In This Thread
Using a switch - by CalvinC - 27.01.2015, 16:20
Re: Using a switch - by Vince - 27.01.2015, 16:41
Re: Using a switch - by Sime30 - 27.01.2015, 16:50
Re: Using a switch - by CalvinC - 27.01.2015, 17:06

Forum Jump:


Users browsing this thread: 1 Guest(s)