Files
GTA4RP/scripts/server/animation.js
Vortrex cfc22a77ee Bunch of fixes/changes
* Set client log level to info
* Added element prop sync util
* Added check to make sure veh upgrade was valid
* Fixed incorrect acct settings being saved
* Added help tip when using invalid anim
* Fixed create biz cmd
* Allow biz owners to set biz name
* Allow biz owners to give biz to player or clan
* Added biz clan rank cmd
* Allow those with permission to lock/unlock biz & houses
* Fix set biz interior
* Allow players with permission to withdraw from biz till
* Added utils to check if player has biz permissions for till/lock/lights
* Added check if players are in same int/vw on talk/shout/whisper
* Follow server civilians cvar when toggling ambience
* Renamed some clan cmds to prefix with "clan"
* Added vehlivery cmd
* Set server log level to debug
* Show veh owner info on enter
* Sync body parts & props on IV
* Add clan help in help cmd
* Don't show values for melee weapons
* Add IV support for some utils
* Sync player ped fight style in SA
* Added fightstyle cmd
* Fix wrong job owner on vehinfo cmd
* Return false on world label support util for IV
2021-09-12 13:53:51 -05:00

57 lines
2.2 KiB
JavaScript

// ===========================================================================
// Vortrex's Roleplay Resource
// https://github.com/VortrexFTW/gtac_roleplay
// ===========================================================================
// FILE: animation.js
// DESC: Provides animation functions and usage
// TYPE: Server (JavaScript)
// ===========================================================================
function initAnimationScript() {
logToConsole(LOG_DEBUG, "[VRR.Animation]: Initializing animation script ...");
logToConsole(LOG_DEBUG, "[VRR.Animation]: Animation script initialized!");
}
// ===========================================================================
function playPlayerAnimationCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let animationSlot = getAnimationFromParams(params);
if(!animationSlot) {
messagePlayerError(client, "That animation doesn't exist!");
messagePlayerInfo(client, "Use /animlist to see a list of valid animations");
return false;
}
getPlayerData(client).currentAnimation = animationSlot;
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
//setEntityData(getPlayerData(client).ped, "vrr.animation", animationSlot, true);
makePedPlayAnimation(getPlayerData(client).ped, animationSlot);
}
// ===========================================================================
function showAnimationListCommand(command, params, client) {
let animList = getGameData().animations[getServerGame()].map(function(x) { return x[0]; });
let chunkedList = splitArrayIntoChunks(animList, 10);
messagePlayerInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Animation List ${getInlineChatColourByType("clanOrange")}===========================`);
for(let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
}
// ===========================================================================
function getAnimationData(animationSlot, gameId = getServerGame()) {
return getGameData().animations[gameId][animationSlot];
}
// ===========================================================================