Delete spawned cars CMD?
#3

I'm confused now. Could you edit this for me?
Code:
new vehToDelete[MAX_VEHICLES];
CMD:veh(playerid, params[]) {

	new vehid,vehicle,engine,lights,alarm,doors,bonnet,boot,objective;
	if(PlayerInfo[playerid][pLevel] < 1) return error
	if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /veh <carid>");
	else if (vehid < 400 || vehid > 611) SendClientMessage(playerid, COLOR_GREY, "[ERROR] Invalid car id! [ Car ID's range from 400 - 611 ]");
	else
	{
		new Float:x, Float:y, Float:z, Float:angle;
		GetPlayerPos(playerid, x, y, z);
		GetPlayerFacingAngle(playerid,angle);
		vehToDelete[vehicle] = CreateVehicle(vehid, x + 3, y, z, angle, 219,251, -1);
		GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleParamsEx(vehid,1,lights,alarm,doors,bonnet,boot,objective);
		SetVehicleNumberPlate(vehToDelete[vehicle],"{FF8000}BHaulers");
		VehicleFuel[vehid] = 100+random(50);
		PutPlayerInVehicle(playerid,vehToDelete[vehicle],0);
		SendClientMessage(playerid, COLOR_GREEN, "Car spawned!");
	}
	return 1;
}

CMD:cleancars(playerid, params[])
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(vehToDelete[i] != -1)
            DestroyVehicle(i);
    }
    return 1;
}
Reply


Messages In This Thread
Delete spawned cars CMD? - by wumpyc - 26.07.2013, 01:21
Re: Delete spawned cars CMD? - by -Prodigy- - 26.07.2013, 02:05
Re: Delete spawned cars CMD? - by wumpyc - 26.07.2013, 03:14
Re: Delete spawned cars CMD? - by [ABK]Antonio - 26.07.2013, 03:21
Re: Delete spawned cars CMD? - by wumpyc - 26.07.2013, 03:34
Re: Delete spawned cars CMD? - by kartik - 26.07.2013, 05:47
Re: Delete spawned cars CMD? - by ThePhenix - 26.07.2013, 06:13
Re: Delete spawned cars CMD? - by wumpyc - 26.07.2013, 06:23
Re: Delete spawned cars CMD? - by kartik - 26.07.2013, 06:33
Re: Delete spawned cars CMD? - by wumpyc - 26.07.2013, 06:37

Forum Jump:


Users browsing this thread: 1 Guest(s)