Plate Check
#2

Try this:

Код:
CMD:sdpc(playerid, params[])
{
	new string[128];
	if(isnull(params)) return SendClientMessage(playerid, COLOUR_WHITE, "SYNTAX: /sdpc [Plate]");
	new vehid = FindVehicleByPlate(params);
	if(vehid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOUR_WHITE, "Invaild Plate");
	SendClientMessage(playerid, COLOUR_WHITE, "Bone County Dept. of Motor Vehicles");
	format(string, sizeof(string), "Owner: %s", CarInfo[vehid][cOwner]);
	SendClientMessage(playerid, COLOUR_WHITE, string);
	format(string, sizeof(string), "Plate: %s", CarInfo[vehid][cPlate]);
	SendClientMessage(playerid, COLOUR_WHITE, string);
	return 1;
}
stock FindVehicleByPlate(plate[])
{
	for(new i = 1; i < MAX_VEHICLES; i++)
	{
	    if(strcmp(CarInfo[i][cPlate], plate, true) == 0)
	    {
	        return i;
	    }
	}
	return INVALID_VEHICLE_ID;
}
I bold and colored what I've added extra.
Reply


Messages In This Thread
Plate Check - by McGuiness - 04.04.2016, 18:12
Re: Plate Check - by Lucky13 - 04.04.2016, 18:29
Re: Plate Check - by McGuiness - 04.04.2016, 18:41
Re: Plate Check - by Lucky13 - 04.04.2016, 18:47
Re: Plate Check - by McGuiness - 04.04.2016, 19:05
Re: Plate Check - by Lucky13 - 04.04.2016, 19:18
Re: Plate Check - by McGuiness - 04.04.2016, 19:29
Re: Plate Check - by Lucky13 - 04.04.2016, 19:35
Re: Plate Check - by Konstantinos - 04.04.2016, 19:47
Re: Plate Check - by McGuiness - 04.04.2016, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)