Add tazed anim + use new anim consts
This commit is contained in:
@@ -19,9 +19,19 @@ function tazePlayer(client) {
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_TAZED;
|
||||
setPlayerControlState(client, false);
|
||||
|
||||
let animationId = getAnimationFromParams("tazed");
|
||||
forcePedAnimation(client.player, animationId);
|
||||
|
||||
getPlayerData(client).currentAnimation = animationId;
|
||||
getPlayerData(client).currentAnimationPositionOffset = toVector3(0.0, 0.0, 0.0);
|
||||
getPlayerData(client).currentAnimationPositionReturnTo = getPlayerPosition(client);
|
||||
getPlayerData(client).animationStart = getCurrentUnixTimestamp();
|
||||
getPlayerData(client).animationForced = true;
|
||||
|
||||
setTimeout(function() {
|
||||
unTazePlayer(client);
|
||||
doActionToNearbyPlayers(client, `The tazer effect wears off`);
|
||||
|
||||
}, getGlobalConfig().tazerEffectDuration);
|
||||
}
|
||||
|
||||
@@ -29,7 +39,12 @@ function tazePlayer(client) {
|
||||
|
||||
function unTazePlayer(client) {
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_READY;
|
||||
|
||||
setPlayerControlState(client, true);
|
||||
setPlayerPosition(client, getPlayerData(client).currentAnimationPositionReturnTo);
|
||||
makePedStopAnimation(getPlayerData(client).ped);
|
||||
setPlayerMouseCameraState(client, false);
|
||||
getPlayerData(client).forcedPedAnimation = -1;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user