Array Problem
#2

That's not how it works, if you want to check if the array contains the number, you have to run a loop and check for each one like this:

Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
        for(new i; sizeof(Bikes); i++)
        {
            if(GetVehicleModel(pVeh[playerid]) != Bikes[i]) continue;
            return PutPlayerInVehicle(playerid, pVeh[playerid], 0);
        }
    }
    return 1;
}
Reply


Messages In This Thread
Array Problem - by NoteND - 02.03.2019, 19:26
Re: Array Problem - by TheToretto - 02.03.2019, 19:46
Re: Array Problem - by NoteND - 02.03.2019, 19:55
Re: Array Problem - by TheToretto - 02.03.2019, 20:03
Re: Array Problem - by Private200 - 02.03.2019, 21:14
Re: Array Problem - by TheToretto - 02.03.2019, 21:38
Re: Array Problem - by Private200 - 02.03.2019, 21:44
Re: Array Problem - by TheToretto - 02.03.2019, 22:20
Re: Array Problem - by Private200 - 03.03.2019, 11:59
Re: Array Problem - by TheToretto - 03.03.2019, 12:04

Forum Jump:


Users browsing this thread: 5 Guest(s)