Re-add old police commands (unfinished)

This commit is contained in:
Vortrex
2022-02-26 21:30:27 -06:00
parent 9b4d88d67a
commit 801f118a02

View File

@@ -6,3 +6,159 @@
// DESC: Provides police officer job functions and usage
// TYPE: Job (JavaScript)
// ===========================================================================
function policeTazerCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================
function policeCuffCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================
function policeArrestCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================
function policeSearchCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================
function policeDragCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================
function policeDetainCommand(command, params, client) {
if(!canPlayerUseJobs(client)) {
messagePlayerError(client, "You are not allowed to use jobs.");
return false;
}
if(!canPlayerUsePoliceJob(client)) {
messagePlayerError(client, "You are not allowed to use the police job.");
return false;
}
if(!isPlayerWorking(client)) {
messagePlayerError(client, "You are not working! Use /startwork first.");
return false;
}
if(!doesPlayerHaveJobType(client, VRR_JOB_POLICE)) {
messagePlayerError(client, "You don't have a police job.");
return false;
}
return true;
}
// ===========================================================================