New force player anim util + use chat section header util
This commit is contained in:
@@ -35,6 +35,10 @@ function playPlayerAnimationCommand(command, params, client) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(getAnimationData(animationSlot)[3] == VRR_ANIMTYPE_SURRENDER) {
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_HANDSUP;
|
||||
}
|
||||
|
||||
if(isPlayerHandCuffed(client) || isPlayerTazed(client) || isPlayerInForcedAnimation(client)) {
|
||||
messagePlayerError(client, `You aren't able to do that`);
|
||||
return false;
|
||||
@@ -71,7 +75,7 @@ function showAnimationListCommand(command, params, client) {
|
||||
|
||||
let chunkedList = splitArrayIntoChunks(animList, 10);
|
||||
|
||||
messagePlayerInfo(client, `{clanOrange}== {jobYellow}Animation List {clanOrange}===========================`);
|
||||
messagePlayerInfo(client, makeChatSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
|
||||
|
||||
for(let i in chunkedList) {
|
||||
messagePlayerNormal(client, chunkedList[i].join(", "));
|
||||
@@ -99,7 +103,7 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
||||
getPlayerData(client).animationForced = false;
|
||||
|
||||
makePedPlayAnimation(getPlayerData(client).ped, animationSlot, animationPositionOffset);
|
||||
makePedPlayAnimation(getPlayerData(client).ped, animationSlot, offsetPosition);
|
||||
|
||||
if(getAnimationData(animationSlot)[9] != VRR_ANIMMOVE_NONE) {
|
||||
if(getGame() < VRR_GAME_GTA_SA) {
|
||||
@@ -109,3 +113,29 @@ function makePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function forcePlayerPlayAnimation(client, animationSlot, offsetPosition = 1) {
|
||||
getPlayerData(client).currentAnimation = animationSlot;
|
||||
getPlayerData(client).currentAnimationPositionOffset = offsetPosition;
|
||||
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
||||
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
||||
getPlayerData(client).animationForced = true;
|
||||
|
||||
setPlayerControlState(client, false);
|
||||
forcePedAnimation(getPlayerData(client).ped, animationSlot, offsetPosition);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function makePlayerStopAnimation(client) {
|
||||
//setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);
|
||||
makePedStopAnimation(getPlayerData(client).ped);
|
||||
|
||||
getPlayerData(client).currentAnimation = -1;
|
||||
getPlayerData(client).currentAnimationPositionOffset = false;
|
||||
getPlayerData(client).currentAnimationPositionReturnTo = false;
|
||||
getPlayerData(client).animationStart = 0;
|
||||
getPlayerData(client).animationForced = false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user