DeleteUnusedCars cmd?
#1

hello

the thread name says it all. I tried to make an "deleteallcars" command but it dont works

Код:
if(strcmp(cmd, "/deleteallcars", true) == 0 || strcmp(cmd, "/dac", true) == 0)
{
 	if(IsPlayerConnected(playerid))
  	{
	  	if(PlayerInfo[playerid][Level] >= 4)
		{
			new bool:unwanted[128];
			for(new player=0; player<MAX_PLAYERS; player++)
	   		{
	      	if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
	   		}
			for(new car = 91; car >= 90; car++)
			{
				if(!unwanted[car]) DestroyVehicle(car);
			}
			new pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
			format(string, sizeof(string), "SERVER: All unused cars deleted by %s.", pname);
			SendClientMessageToAll(COLOR_WHITE,string);
		}
		else
		{
		 	SendClientMessage(playerid, red, "you are not authorized to use this command!");
		  	return 1;
		}
	}
	return 1;
}
can somebody say me what I did wrong? or can somebody make me an working script?
Reply


Messages In This Thread
DeleteUnusedCars cmd? - by xZacharias - 19.08.2010, 18:47
Re: DeleteUnusedCars cmd? - by Jefff - 19.08.2010, 18:59
Re: DeleteUnusedCars cmd? - by xZacharias - 19.08.2010, 20:33
Re: DeleteUnusedCars cmd? - by Matthias_ - 19.08.2010, 21:04

Forum Jump:


Users browsing this thread: 1 Guest(s)