Skip to content

Commit

Permalink
Fixed addon list permissions issue
Browse files Browse the repository at this point in the history
  • Loading branch information
TomGrobbe committed Apr 6, 2018
1 parent 2a1fdde commit 9de2eea
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,7 @@ public async void SpawnVehicle(string vehicleName = "custom", bool spawnInside =
{
// Convert it into a model hash.
uint model = (uint)GetHashKey(result);
int modelClass = GetVehicleClassFromName(model);
//var tmpMenu = new VehicleSpawner()
if (MainMenu.VehicleSpawnerMenu.allowedCategories[modelClass])
{
SpawnVehicle(vehicleHash: model, spawnInside: spawnInside, replacePrevious: replacePrevious, skipLoad: false);
}
else
{
Notify.Alert("You are not allowed to spawn this vehicle, because it belongs to a category which is restricted by the server owner.");
}
SpawnVehicle(vehicleHash: model, spawnInside: spawnInside, replacePrevious: replacePrevious, skipLoad: false);
}
// Result was invalid.
else
Expand All @@ -594,6 +585,14 @@ public async void SpawnVehicle(string vehicleName = "custom", bool spawnInside =
/// <param name="skipLoad">If true, this will not load or verify the model, it will instantly spawn the vehicle.</param>
public async void SpawnVehicle(uint vehicleHash, bool spawnInside, bool replacePrevious, bool skipLoad = false, Dictionary<string, string> vehicleInfo = null, string saveName = null)
{
var vehClass = GetVehicleClassFromName(vehicleHash);
int modelClass = GetVehicleClassFromName(vehicleHash);
if (!MainMenu.VehicleSpawnerMenu.allowedCategories[modelClass])
{
Notify.Alert("You are not allowed to spawn this vehicle, because it belongs to a category which is restricted by the server owner.");
return;
}

if (!skipLoad)
{
bool successFull = await LoadModel(vehicleHash);
Expand Down

0 comments on commit 9de2eea

Please sign in to comment.