Hey everyone, this is a very simple script that adds stress factor to the game.
I have added all the basic events and actions that add stress to the players, and one for remove.
I have also provided you with examples of how to add or remove stress in desired events, and also how to add or remove stress on item usage such as cigarettes.
What happens when you build up stress?
- Your camera begins to shake according to your stress level.
- Shaking gets more frequent and stronger as stress rises.
- After %60 you also have some hard time driving.
- At maximum, your vision gets a bit blurry and shaking gets very often and strong.
Adding status bar: [RELEASE] TREW HUD UI - A lightweight HUD for ESX, VRP AND VRPEX
Adding stress from other resources:
Client Side
exports['stress_utk']:AddStress('instant', value) -- Adds "value" stress instantly
example: exports['stress_utk']:AddStress("instant", 100000) -- will add 100.000 stress which is %10
exports['stress_utk']:AddStress('slow', value, seconds) -- Adds "value" stress gradually in "seconds" seconds ex:
example: exports['stress_utk']:AddStress('slow', 500000, 10) -- Adds 500.000 stress which is %50 in 10 seconds
exports['stress_utk']:RemoveStress('instant', value) -- Removes "value" stress instantly
exports['stress_utk']:RemoveStress('slow', value, seconds) -- Removes "value" stress gradually in "seconds" seconds
You can see all the events that add stress, I’ve added lots of comments in the code.
Have fun!
Possible Natives, events?
-
HasPlayerBeenSpottedInStolenVehicle not sure how this works, will test it
-
HasPlayerDamagedAtLeastOnePed and HasPlayerDamagedAtLeastOneNonAnimalPed could be interesting
-
CanPedSeeHatedPed maybe just maybe used for “can see the dangerous ped” thing?
-
GetClosestPed can be used if a certain type of ped is near like SWAT, I don’t know
-
GetPedDefensiveAreaPosition I have no idea what this is, will test it
-
GetPedNearbyPeds can be used to get number of peds nearby and make it a stress thing, like the crowd I don’t know, again
-
GetPlayerPedIsFollowing this I think can be useful, for example, my warehouse script which sometimes aggressive peds fallow you and try to kill you, not sure tho
-
GetRelationshipBetweenPeds can be used if you use some sort of gang script which involves also gang NPC’s, also check this RegisterHatedTargetsAroundPed
-
GetVehiclePedIsUsing or IsPedInAnyPoliceVehicle can be used for normal players who try to use police cars
-
IsAnyHostilePedNearPoint and IsAnyPedShootingInArea needs testing, I have no idea
-
IsCopPedInArea_3d ?
-
IsPedBeingStunned ??
-
IsPedJacking and IsPedBeingJacked and IsPedTryingToEnterALockedVehicle can be useful I don’t know, again
-
IsPedShootingInArea I think this can be used to detect if some other ped is shooting near the player, not sure
-
GetPlayerUnderwaterTimeRemaining can be useful to make underwater scary
-
IsVehicleAlarmActivated can be used for stealing car
-
IsVehicleTyreBurst can be useful
-
HasPedBeenDamagedByWeapon and ClearPedLastWeaponDamage can be used togather I guess, I’m not sure