Remove old util
This commit is contained in:
@@ -3074,10 +3074,12 @@ function canPlayerLockUnlockBusiness(client, businessId) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function canPlayerManageBusiness(client, businessId) {
|
function canPlayerManageBusiness(client, businessId, exemptAdminFlag = false) {
|
||||||
|
if (exemptAdminFlag == false) {
|
||||||
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
|
if (doesPlayerHaveStaffPermission(client, getStaffFlagValue("ManageBusinesses"))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) {
|
if (getBusinessData(businessId).ownerType == AGRP_BIZ_OWNER_PLAYER) {
|
||||||
if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
if (getBusinessData(businessId).ownerId == getPlayerCurrentSubAccount(client).databaseId) {
|
||||||
|
|||||||
@@ -879,34 +879,6 @@ function canPlayerManageVehicle(client, vehicle, exemptAdminFlag = false) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function doesPlayerOwnVehicle(client, vehicle) {
|
|
||||||
let vehicleData = getVehicleData(vehicle);
|
|
||||||
|
|
||||||
if (vehicleData.ownerType == AGRP_VEHOWNER_PLAYER) {
|
|
||||||
if (vehicleData.ownerId == getPlayerData(client).accountData.databaseId) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vehicleData.ownerType == AGRP_VEHOWNER_CLAN) {
|
|
||||||
if (vehicleData.ownerId == getPlayerCurrentSubAccount(client).clan) {
|
|
||||||
if (doesPlayerHaveClanPermission(client, "ManageVehicles")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (vehicleData.ownerType == AGRP_VEHOWNER_BIZ) {
|
|
||||||
if (canPlayerManageBusiness(client, getBusinessIdFromDatabaseId(vehicleData.ownerId), true)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setVehicleJobCommand(command, params, client) {
|
function setVehicleJobCommand(command, params, client) {
|
||||||
if (!isPlayerInAnyVehicle(client)) {
|
if (!isPlayerInAnyVehicle(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "MustBeInAVehicle"));
|
messagePlayerError(client, getLocaleString(client, "MustBeInAVehicle"));
|
||||||
|
|||||||
Reference in New Issue
Block a user