#1

Yo!
Well the problem is when u type /veh you can only type the id of the car and it takes some times to find out the id of the car. So i have noticed that some servers that you can both type the car name and the id. How to do it like that?
Here is the command
Код:
CMD:veh(playerid, params[]) {
	if (PlayerInfo[playerid][pAdmin] >= 4) {

		new
			iVehicle,
			iColors[2];

		if(sscanf(params, "iii", iVehicle, iColors[0], iColors[1])) {
			SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /veh [model ID] [color 1] [color 2]");
		}
		else if(!(400 <= iVehicle <= 611)) {
			SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid model specified (model IDs start at 400, and end at 611).");
		}
		else if(!(0 <= iColors[0] <= 255 && 0 <= iColors[1] <= 255)) {
			SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid colour specified (IDs start at 0, and end at 255).");
		}
		else for(new iIterator; iIterator < sizeof(CreatedCars); iIterator++) if(CreatedCars[iIterator] == INVALID_VEHICLE_ID) {

			new
				Float: fVehPos[4];

			GetPlayerPos(playerid, fVehPos[0], fVehPos[1], fVehPos[2]);
			GetPlayerFacingAngle(playerid, fVehPos[3]);
			CreatedCars[iIterator] = AddStaticVehicleEx(iVehicle, fVehPos[0], fVehPos[1], fVehPos[2], fVehPos[3], iColors[0], iColors[1], -1);
			VehicleFuel[CreatedCars[iIterator]] = 100.0;
			LinkVehicleToInterior(CreatedCars[iIterator], GetPlayerInterior(playerid));
			return SendClientMessageEx(playerid, COLOR_GREY, "Vehicle spawned!");
		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	return 1;
}
Reply


Messages In This Thread
/veh - by TonyNames - 06.03.2014, 19:50
Re: /veh - by Mriss - 06.03.2014, 19:51
Re: /veh - by Drago987 - 06.03.2014, 20:07
Re: /veh - by XK - 06.03.2014, 21:25
Re: /veh - by FutureGenerationGaming - 06.03.2014, 22:58
Re: /veh - by XK - 06.03.2014, 23:05
Re: /veh - by FutureGenerationGaming - 06.03.2014, 23:44
Re: /veh - by TonyNames - 08.03.2014, 12:35
Re: /veh - by Shawn912 - 09.03.2014, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)