help command /veh
#1

Hello as the Title say i need help with this command /veh if some1 are experianced with this i wud love to get help here is what i want help with

first of all i just want the command to work like > /veh [ID] atm i have to use /veh [ID] [color1] [Color2]

and also when you write for example /veh 411
you spawn a infernus and atm you spawn outside it i want the player to spawn inside it!

please help me with this since iam not experianced to do it myself
i will ofcourse add you reputition!


Here is my code
Код:
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] = CreateVehicle(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
help command /veh - by showarn - 29.11.2012, 18:56
Re: help command /veh - by blackbhuta - 29.11.2012, 20:40
Re: help command /veh - by showarn - 30.11.2012, 03:43
Re: help command /veh - by cosbraa - 30.11.2012, 03:47
Re: help command /veh - by showarn - 30.11.2012, 04:08
Re: help command /veh - by cosbraa - 30.11.2012, 04:36
Re: help command /veh - by [MM]RoXoR[FS] - 30.11.2012, 05:23
Re: help command /veh - by goviscrap - 30.11.2012, 05:27
Re: help command /veh - by showarn - 30.11.2012, 14:32
Re: help command /veh - by showarn - 30.11.2012, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)