Initial commit
This commit is contained in:
183
scripts/server/job/police.js
Normal file
183
scripts/server/job/police.js
Normal file
@@ -0,0 +1,183 @@
|
||||
// ===========================================================================
|
||||
// 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;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user