Files
GTA4RP/scripts/server/anticheat.js
2022-12-19 10:11:10 -06:00

78 lines
2.4 KiB
JavaScript

// ===========================================================================
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/v-roleplay
// ===========================================================================
// FILE: anticheat.js
// DESC: Provides anticheat functions and usage
// TYPE: Server (JavaScript)
// ===========================================================================
function initAntiCheatScript() {
logToConsole(LOG_DEBUG, "[AGRP.AntiCheat]: Initializing anticheat script ...");
logToConsole(LOG_DEBUG, "[AGRP.AntiCheat]: Anticheat script initialized!");
}
// ===========================================================================
function clearPlayerStateToEnterExitProperty(client) {
if (getPlayerData(client).pedState != V_PEDSTATE_READY) {
if (getPlayerData(client).pedState == V_PEDSTATE_ENTERINGVEHICLE) {
sendPlayerClearPedState(client);
getPlayerData(client).pedState = V_PEDSTATE_READY;
} else {
return false;
}
}
}
// ===========================================================================
function isPlayerExemptFromAntiCheat(client) {
if (hasBitFlag(getPlayerData(client).accountData.flags.moderation, getModerationFlagValue("ExemptFromAntiCheat"))) {
return true;
}
return false;
}
// ===========================================================================
function canPlayerUsePoliceJob(client) {
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.policeBanned) {
return false;
}
return true;
}
// ===========================================================================
function canClientUseFireJob(client) {
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.fireBanned) {
return false;
}
return true;
}
// ===========================================================================
function canClientUseAmmunations(client) {
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.AmmuBanned) {
return false;
}
return true;
}
// ===========================================================================
function canClientUseGuns(client) {
if (getPlayerData(client).accountData.flags.moderation & getServerBitFlags().moderationFlags.GunBanned) {
return false;
}
return true;
}
// ===========================================================================