Move utils
This commit is contained in:
@@ -1509,89 +1509,8 @@ async function triggerWebHook(webHookURL, payloadData) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function clearTemporaryVehicles() {
|
|
||||||
let vehicles = getElementsByType(ELEMENT_VEHICLE);
|
|
||||||
for(let i in vehicles) {
|
|
||||||
if(vehicles[i].owner == -1) {
|
|
||||||
if(!getVehicleData(vehicles[i])) {
|
|
||||||
if(isVehicleUnoccupied(vehicles[i])) {
|
|
||||||
destroyElement(vehicles[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function clearTemporaryPeds() {
|
|
||||||
let peds = getElementsByType(ELEMENT_PED);
|
|
||||||
for(let i in peds) {
|
|
||||||
if(peds[i].owner == -1) {
|
|
||||||
if(!peds[i].isType(ELEMENT_PLAYER)) {
|
|
||||||
if(peds[i].vehicle == null) {
|
|
||||||
if(!getNPCData(peds[i])) {
|
|
||||||
destroyElement(peds[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function getVehicleTrunkPosition(vehicle) {
|
function getVehicleTrunkPosition(vehicle) {
|
||||||
return getPosBehindPos(getVehiclePosition(vehicle), getVehicleHeading(vehicle), 3);
|
return getPosBehindPos(getVehiclePosition(vehicle), getVehicleHeading(vehicle), getGlobalConfig().vehicleTrunkRearDistance);
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isPlayerWeaponBanned(client) {
|
|
||||||
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("WeaponBanned"))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isPlayerJobBanned(client) {
|
|
||||||
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("JobBanned"))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isPlayerPoliceBanned(client) {
|
|
||||||
let jobId = getJobFromParams("Police");
|
|
||||||
if(doesJobHaveWhiteListEnabled(jobId)) {
|
|
||||||
if(isPlayerOnJobWhiteList(client, jobId)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(doesJobHaveBlackListEnabled(jobId)) {
|
|
||||||
if(!isPlayerOnJobBlackList(client, jobId)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function isPlayerExemptFromAntiCheat(client) {
|
|
||||||
if(hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user