Run Time Error 4
#4

Why did you use foreach? It should be a for loop and use the size of VehicleNamesEx array.

pawn Код:
GetVehicleIDFromNameEx(vehiclename[])
{
    for (new i; i != sizeof (VehicleNamesEx); ++i)
    {
        if(strfind(VehicleNamesEx[i], vehiclename, false) != -1) return i + 400;
    }
    return -1;
}
By the way, why do you use VehicleNames and VehicleNamesEx arrays? One would be fine unless you have different vehicle names.
Reply


Messages In This Thread
Run Time Error 4 - by bgedition - 23.05.2015, 11:49
Re: Run Time Error 4 - by Konstantinos - 23.05.2015, 12:01
Re: Run Time Error 4 - by bgedition - 23.05.2015, 14:06
Re: Run Time Error 4 - by Konstantinos - 23.05.2015, 14:12
Re: Run Time Error 4 - by bgedition - 23.05.2015, 14:17
Re: Run Time Error 4 - by Konstantinos - 23.05.2015, 14:37
Re: Run Time Error 4 - by bgedition - 23.05.2015, 14:43
Re: Run Time Error 4 - by Konstantinos - 23.05.2015, 14:56

Forum Jump:


Users browsing this thread: 2 Guest(s)