/vx [vehicle name] HELP
#2

Have you read GetVehicleModelIDFromName function?
pawn Код:
stock GetVehicleModelIDFromName(vehname[])
{
        for(new i = 0; i < 211; i++)
        {
                if (strfind(VehicleNames[i], vehname, true) != -1) return i + 400;
        }
        return -1;
}
It adds + 400 so it will be between 400-611.

So change to:
pawn Код:
if(vehid < 400 || vehid > 611) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: Invalid Vehicle Name.");
and
pawn Код:
format(message, sizeof(message), "[Info] %s has spawned a %s (ID: %d).", name, VehicleNames[vehid - 400], vehid);
Reply


Messages In This Thread
/vx [vehicle name] HELP - by Tomer!.$ - 01.09.2013, 13:04
Re: /vx [vehicle name] HELP - by Konstantinos - 01.09.2013, 13:14
Re: /vx [vehicle name] HELP - by Tomer!.$ - 01.09.2013, 13:29

Forum Jump:


Users browsing this thread: 1 Guest(s)