12.04.2017, 12:36
Quote:
He is checking nothing. Because his function is bullshit.
Code:
stock GetVehicleModelFromName(const vname[]) { for(new i = 0; i < 211; i++) { if(strfind(VehicleNames[i], vname, true) != -1) { return i + 400; } } return -1; } |
PHP Code:
if (sscanf(vehicle_name, "i", vehicleid))
{
for (new i = 0; i < sizeof (VehicleNames); i++)
{
if (strfind(VehicleNames[i], vehicle_name, true) != -1)
{
vehicleid = i + 400;
}
}
}
else if (!(400 <= vehicleid <= 611)) vehicleid = -1;
Checking if vehicle_name is a string
other wise check if the vehicle id is between 400 and 611
else if (!(400 <= vehicleid <= 611))
So his code seems to be fine to me.