Foreach.
#3

Here is an example :


pawn Код:
new Iterator:CarUse<700>;



public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/usecar", true))
    {
        Iter_Add(CarUse, GetPlayerVehicleID(playerid) - 1);
        return 1;
    }
    if(!strcmp(cmdtext, "/stopusingcar", true))
    {
        Iter_Remove(CarUse, GetPlayerVehicleID(playerid) - 1);
        return 1;
    }
    if(!strcmp(cmdtext, "/carsbeingused", true))
    {
        foreach(CarUse, x)
        {
            printf("ID: %d", x + 1);
        }
        return 1;
    }
    return 0;
}


I hope that I have helped .
Reply


Messages In This Thread
Foreach. - by budelis - 27.10.2012, 08:13
Re: Foreach. - by ryansheilds - 28.10.2012, 17:22
Re: Foreach. - by rjjj - 28.10.2012, 17:44

Forum Jump:


Users browsing this thread: 2 Guest(s)