Rename all net event prefixes to agrp

This commit is contained in:
Vortrex
2022-06-14 08:53:33 -05:00
parent 48c9af3f52
commit d1b8b9524f
25 changed files with 824 additions and 841 deletions

View File

@@ -15,7 +15,7 @@ function initAnimationScript() {
// ===========================================================================
function playPlayerAnimationCommand(command, params, client) {
if(areParamsEmpty(params)) {
if (areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
@@ -23,22 +23,22 @@ function playPlayerAnimationCommand(command, params, client) {
let animationSlot = getAnimationFromParams(getParam(params, " ", 1));
let animationPositionOffset = 1;
if(!animationSlot) {
if (!animationSlot) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimation"));
messagePlayerInfo(client, getLocaleString(client, "AnimationCommandTip", `{ALTCOLOUR}/animlist{MAINCOLOUR}`));
return false;
}
if(toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
if (toInteger(animationPositionOffset) < 0 || toInteger(animationPositionOffset) > 3) {
messagePlayerError(client, getLocaleString(client, "InvalidAnimationDistance"));
return false;
}
if(getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
if (getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP;
}
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false;
}
@@ -50,7 +50,7 @@ function playPlayerAnimationCommand(command, params, client) {
// ===========================================================================
function stopPlayerAnimationCommand(command, params, client) {
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
if (isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
messagePlayerError(client, getLocaleString(client, "UnableToDoThat"));
return false;
}
@@ -70,13 +70,13 @@ function stopPlayerAnimationCommand(command, params, client) {
// ===========================================================================
function showAnimationListCommand(command, params, client) {
let animList = getGameConfig().animations[getGame()].map(function(x) { return x.name; });
let animList = getGameConfig().animations[getGame()].map(function (x) { return x.name; });
let chunkedList = splitArrayIntoChunks(animList, 10);
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
for(let i in chunkedList) {
for (let i in chunkedList) {
messagePlayerNormal(client, chunkedList[i].join(", "));
}
}
@@ -107,7 +107,7 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
getPlayerData(client).animationForced = false;
makePedPlayAnimation(getPlayerPed(client), animationSlot, offsetPosition);
setEntityData(getPlayerPed(client), "vrr.anim", animationSlot, true);
setEntityData(getPlayerPed(client), "agrp.anim", animationSlot, true);
//if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
// if(getGame() < VRR_GAME_GTA_SA) {
// setPlayerMouseCameraState(client, true);
@@ -125,7 +125,7 @@ function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
getPlayerData(client).animationForced = true;
setPlayerControlState(client, false);
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
forcePedAnimation(getPlayerPed(client), animationSlot, offsetPosition);
}
// ===========================================================================
@@ -145,14 +145,14 @@ function makePlayerStopAnimation(client) {
function getAnimationFromParams(params) {
let animations = getGameConfig().animations[getGame()];
if(isNaN(params)) {
for(let i in animations) {
if(toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) {
if (isNaN(params)) {
for (let i in animations) {
if (toLowerCase(animations[i].name).indexOf(toLowerCase(params)) != -1) {
return i;
}
}
} else {
if(typeof getGameConfig().animations[getGame()][params] != "undefined") {
if (typeof getGameConfig().animations[getGame()][params] != "undefined") {
return toInteger(params);
}
}