Switch troubles
#5

I guess this is what you wanted to do:
pawn Код:
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    for(new i<0; i<sizeof(Variable); i++) //Loop through the Variable index
    {
        if(pickupid == Variable[i]) //If it is same as the number which is stored in Variable[index]
        {
            switch(i) //switching the index number.
            {
                case 0: return 1;
                case 1: return 1;
                case 2: return 1;
                case 3: return 1;
                case 4: return 1;
            }
        }
    }
    return 1;
}
Try it out.


Jeffry
Reply


Messages In This Thread
Switch troubles - by OldDirtyBastard - 30.05.2011, 14:59
AW: Switch troubles - by Nero_3D - 30.05.2011, 15:02
Re: Switch troubles - by OldDirtyBastard - 30.05.2011, 15:04
AW: Switch troubles - by Nero_3D - 30.05.2011, 15:47
Re: Switch troubles - by Jeffry - 30.05.2011, 15:52
Re: Switch troubles - by OldDirtyBastard - 30.05.2011, 16:04
Re: Switch troubles - by Jeffry - 30.05.2011, 16:12

Forum Jump:


Users browsing this thread: 1 Guest(s)