How to set this into /destroyallcades?
#1

So basically i have this /destroycades

but i want to make /destroyallcades

Код:
CMD:destroycade(playerid, params[])
{
	if(CheckGMX(playerid)) return 1;
	if(IsACop(playerid))
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			SendClientMessage(playerid, COLOR_GREY, "You must be on foot to use this command.");
			return 1;
		}
		if(PlayerInfo[playerid][pRank] < 3 && PlayerInfo[playerid][pFaction] != 2)
		{
			SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 3 to use this command.");
			return 1;
		}
		new string[128], Float:Position[3];
		for(new i; i<MAX_BARRICADES; i++)
		{
			GetDynamicObjectPos(Barricade[i], Position[0], Position[1], Position[2]);

			if(IsPlayerInRangeOfPoint(playerid, 5.0, Position[0], Position[1], Position[2]))
			{
				DestroyDynamicObject(Barricade[i]);
				Barricade[i] = 0;
				new zone[MAX_ZONE_NAME];
				GetPlayer3DZone(playerid, zone, sizeof(zone));
				format(string, sizeof(string), "HQ: A barricade has been destroyed by %s at %s.", GetPlayerNameEx(playerid), zone);
				foreach(Player, x)
				{
					if(IsACop(x))
					{
						SendClientMessage(x, TEAM_BLUE_COLOR, string);
					}
				}
				return 1;
			}
		}
		SendClientMessage(playerid, COLOR_GREY, "You're not near any barricades.");
	}
	else
	{
		SendClientMessage(playerid, COLOR_GREY, "You're not a law enforcement officer.");
	}
	return 1;
}
Thank you very much
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)