Files
GTA4RP/scripts/server/job/police.js
2020-09-04 15:56:19 -05:00

183 lines
5.0 KiB
JavaScript

// ===========================================================================
// Asshat Gaming RP
// http://asshatgaming.com
// © 2019 Asshat Gaming
// ---------------------------------------------------------------------------
// FILE: police.js
// DESC: Provides police officer job functions and usage
// TYPE: Job (JavaScript)
// ===========================================================================
function policeTazerCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)){
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------
function policeCuffCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)) {
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------
function policeArrestCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)) {
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------
function policeSearchCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)) {
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------
function policeDragCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)) {
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------
function policeDetainCommand(command, params, client) {
if(!canClientUseJobs(client) || !!canClientUsePoliceJob(client)) {
return false;
}
if(doesCommandRequireLogin(command)) {
if(!isClientLoggedIn(client)) {
messageClientError(client, "You are not logged in!");
return false;
}
}
if(isClientFromDiscord(client)) {
if(!isCommandAllowedOnDiscord(command)) {
messageClientError(client, "That command isn't available on discord!");
return false;
}
}
if(!doesClientHaveStaffPermission(client, getCommandRequiredPermissions(command))) {
messageClientError(client, "You do not have permission to use this command!");
return false;
}
return true;
}
// ---------------------------------------------------------------------------