05.11.2013, 15:12
(
Последний раз редактировалось iFiras; 11.09.2014 в 03:12.
)
Deleted.
DestroyVehicle(PlayersVehicle);
new PlayersVehicle[MAX_PLAYERS];
PlayersVehicle[playerid] = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
the one that the admin created.
EDIT: oh,you want to delete all vehicles,sorry for misunderstanding ... You can add [MAX_PLAYERS] to where you create the PlayersVehicle array is pawn Код:
pawn Код:
|
new PlayersVehicle[MAX_PLAYERS];
new amount_of_vehicles = 0;
if(strcmp(cmd, "/createveh", true, 10) == 0)
{
if(AdminLevel[playerid] < 5) return SCM(playerid,COLOR_WHITE,"{FF0000}[ERROR] {FFFFFF}You don't have an appropriate administration to use this command.");
new String[200];
new tmp[256];
new Float:x, Float:y, Float:z;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, ""COL_ORANGE"[USAGE] {FFFFFF}/createveh [VEHICLE_NAME]");
new vehicle = GetVehicleModelIDFromName(tmp);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, COLOR_WHITE, "{FF0000}[ERROR] {FFFFFF}Invalid vehicle name.");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
PlayersVehicle[amount_of_vehicles] = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
amount_of_vehicles++;
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
format(String, sizeof(String), ""COL_ADMIN"[ADMIN] {FFFFFF}You have spawned a \"%s\"", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, COLOR_WHITE, String);
return 1;
}
for(new x = 0; x < amount_of_vehicles; x++){
DestroyVehicle(PlayersVehicle[x]);
}