/veh cmd
#5

Код:
CMD:veh(playerid, params[]) {
	new Vehicle[50], VehicleID, Color[2], Siren, Float:pX, Float:pY, Float:pZ, Float:pA, string[512];
	format(string, sizeof(string), "[USAGE]: /veh [VehicleName/VehicleID] [Color 1 (optional)] [Color 2 (optional)] [Siren 0/1 (optional)]");
	if(sscanf(params, "s[50]D(0)D(0)D(0)", Vehicle, Color[0], Color[1], Siren)) return SendClientMessage(playerid, -1, string);
	VehicleID = GetVehicleIDFromName(Vehicle);
	if(VehicleID == -1) {
		VehicleID = strval(Vehicle);
	}
	format(string, sizeof(string), "[WARNING]: Invalid vehicle ID! To find vehicle's ID use /vid.");
	if(VehicleID < 400 || VehicleID > 611) return SendClientMessage(playerid, -1, string);
	if(Siren < 0 || Siren > 1) return SendClientMessage(playerid, -1, "[INFO]: Add siren 0/1. 0 - No, 1 - Yes.");
	if(IsPlayerInAnyVehicle(playerid) == 1) return SendClientMessage(playerid, -1, "[WARNING]: You are now in vehicle. Please exit and then spawn new one!");
	GetPlayerPos(playerid, pX, pY, pZ);
	GetPlayerFacingAngle(playerid, pA);
	DestroyVehicle(SpawnedVehicle[playerid]);
	SpawnedVehicle[playerid] = CreateVehicle(VehicleID, pX, pY, pZ + 0.5, pA, Color[0], Color[1], -1, Siren);
	LinkVehicleToInterior(SpawnedVehicle[playerid], GetPlayerInterior(playerid));
	SetVehicleVirtualWorld(SpawnedVehicle[playerid], GetPlayerVirtualWorld(playerid));
	PutPlayerInVehicle(playerid, SpawnedVehicle[playerid], 0);
	format(string, sizeof(string), "[INFO]: You successfully spawned \"%s\" (ID: %d). Enjoy it!", GetVehicleName(GetPlayerVehicleID(playerid)), GetVehicleIDFromName(GetVehicleName(GetPlayerVehicleID(playerid))));
	SendClientMessage(playerid, -1, string);
	return 1;
}
Reply


Messages In This Thread
/veh cmd - by bgedition - 04.05.2015, 14:00
Re: /veh cmd - by iPrivate - 04.05.2015, 14:02
Re: /veh cmd - by bgedition - 04.05.2015, 14:11
Re: /veh cmd - by iPrivate - 04.05.2015, 14:21
Re: /veh cmd - by X337 - 04.05.2015, 14:23
Re: /veh cmd - by bgedition - 04.05.2015, 14:37
Re: /veh cmd - by Konstantinos - 04.05.2015, 14:44
Re: /veh cmd - by bgedition - 04.05.2015, 14:49
Re: /veh cmd - by Konstantinos - 04.05.2015, 14:53
Re: /veh cmd - by bgedition - 04.05.2015, 14:57

Forum Jump:


Users browsing this thread: 2 Guest(s)