Delete spawned cars CMD?
#6

Try this:
pawn Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define MAX_Vehicles 100

new vehicles[MAX_Vehicles];
new vehid,vehicle,engine,lights,alarm,doors,bonnet,boot,objective;
CMD:Veh(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Message");  //your  level checks,colors
else
{
if(sscanf(params, "i", vehid)) return SendClientMessage(playerid, -1, "USAGE: /veh <carid>");
else if (vehid < 400 || vehid > 611) SendClientMessage(playerid, -1, "[ERROR] Invalid car id! [ Car ID's range from 400 - 611 ]");
else
{
new float:x,float:y,float:z,float:a;

GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
new i=0 ;
if(i<Max_vehicles)
{
vehicles[i]=CreateVehicle(vehid,x,y,z,a,random(126),random(126),150000);
GetVehicleParamsEx(vehid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehid,1,lights,alarm,doors,bonnet,boot,objective);
ChangeVehicleColor(vehicle, 219, 251);
SetVehicleNumberPlate(vehicle,"{FF8000}BHaulers");
PutPlayerInVehicle(playerid,vehicle,0);
i++;
}
return SendClientMessage(playerid,-1,"Vehicle Spawned!");  //your  colors
}
return 1;
}
}
CMD:Cleanup(playerid)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Message");  //your  level checks,colors
else
{
for(new i;i<=count;i++)
{
DestroyVehicle(vehicles[i]);
}
return SendClientMessageToAll(-1,"Spwaned Cars Have Been Cleared"),1;
}
}
PS: You'll get tag mismatch warnings (I haven't changed your variables!)
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)