Lots of changes

* Add optional offset for some anims (like sitting)
* Fix int/vw chat check not working
* Disable ambience utils for now
* Add ped stop anim util
* Fix enter veh messages
* Fix radio stream not stopping when exiting vehicle
* Fix job items bugging out
* Don't save job equipment items
* Switch to inactive item slot when going on/off duty
* Fix gotospawn not working with int/vw
* Added anims for offset use
* Added element ID & syncer utils
* Fixed wrong job name being shown when setting job vehicle rank
* Added anim move type constants
* Added element collision net events
* Added is any GUI active util
* Fixed showing player list when a GUI is active
This commit is contained in:
Vortrex
2021-09-13 07:22:00 -05:00
parent cfc22a77ee
commit acfc788371
17 changed files with 319 additions and 134 deletions

View File

@@ -140,23 +140,23 @@ function showGameMessage(client, text, colour, duration) {
// ===========================================================================
function enableCityAmbienceForPlayer(client, clearElements = false) {
if(server.getCVar("civilians") == false) {
return false;
}
//if(server.getCVar("civilians") == false) {
// return false;
//}
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
triggerNetworkEvent("vrr.ambience", client, true);
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
//triggerNetworkEvent("vrr.ambience", client, true);
}
// ===========================================================================
function disableCityAmbienceForPlayer(client, clearElements = false) {
if(server.getCVar("civilians") == true) {
return false;
}
//if(server.getCVar("civilians") == true) {
// return false;
//}
logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
triggerNetworkEvent("vrr.ambience", client, false, clearElements);
//logToConsole(LOG_DEBUG, `[VRR.Client] Setting ${getPlayerDisplayForConsole(client)}'s city ambience to ${toUpperCase(getOnOffFromBool(false))}`);
//triggerNetworkEvent("vrr.ambience", client, false, clearElements);
}
// ===========================================================================
@@ -928,10 +928,35 @@ function sendPlayerEnterPropertyKey(client, key) {
// ===========================================================================
function makePedPlayAnimation(ped, animationSlot) {
function makePedPlayAnimation(ped, animationSlot, positionOffset) {
let animationData = getAnimationData(animationSlot);
if(animationData[9] != VRR_ANIMMOVE_NONE) {
setElementCollisionsEnabled(ped, false);
switch(animationData[9]) {
case VRR_ANIMMOVE_FORWARD:
setElementPosition(ped, getPosInFrontOfPos(getElementPosition(ped), getElementHeading(ped), positionOffset));
break;
triggerNetworkEvent("vrr.pedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4]);
case VRR_ANIMMOVE_BACK:
setElementPosition(ped, getPosBehindPos(getElementPosition(ped), getElementHeading(ped), positionOffset));
break;
case VRR_ANIMMOVE_LEFT:
setElementPosition(ped, getPosToLeftOfPos(getElementPosition(ped), getElementHeading(ped), positionOffset));
break;
case VRR_ANIMMOVE_RIGHT:
setElementPosition(ped, getPosToRightOfPos(getElementPosition(ped), getElementHeading(ped), positionOffset));
break;
}
}
triggerNetworkEvent("vrr.pedAnim", null, ped.id, animationData[1], animationData[2], animationData[3], animationData[4], animationData[5], positionOffset);
}
// ===========================================================================
function makePedStopAnimation(ped) {
triggerNetworkEvent("vrr.pedStopAnim", null, ped.id);
}
// ===========================================================================