[RELEASE] [UPDATED 19.12.2019] Stress System with logs by utku, esx_status

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

14 Likes

NICE WORK MAN !! But how to get out from stress ??? No item or sql file you uploaded !

Check out esx_basicneeds file, you will understand.

1 Like

also to reset your stress use admin command /heal

ya got it

`ESX.RegisterUsableItem('İTEM_İSMİ', function(source) -- İTEM_İSMİ kısmına item ismini yazın (sigara) // replace your item with İTEM_İSMİ
	local xPlayer = ESX.GetPlayerFromId(source)`

I can register any item instead of your item !! nice work :slight_smile:

1 Like

yes but make sure you added the item in db too

ya ik ! great release bro

Perfect job as usual. Great release @utkuali ! :nerd_face:

EN : Nice work bro,.

TR: Eline sağlık la :smiley:

Great release.

great , im going to try it

kurulumu anlatabilir misin

1 Like

Readme de var kurulum

good esx script!

Yapıyorum İtem Yerine Denemek İçin “bread” Yazıyorum Fakat Hiçbir Şey Olmuyor Ateş Ediliyor Bir Şey Olmuyor Yardımcı Olabilir misiniz

readme yi iyice okuyup yaptın mı? esx_basicneeds’ de değişiklikler yapman lazım

Evet Aynısını Tektek Uyguladım

Is this having a stress bar too to show how hard the stress is?

1 Like

No, you need to make it yourself. I can ask the author of the disc-hud for permission to publish my edited version of it which includes stress bar actually.

Disc-hud kullanıyorum stress çalışıyor fakat oyuna ilk kez girenlere (kayıt olanlarda) stress barı full bir şekilde geliyor. Karakteri oluştururken “TriggerClientEvent(‘esx_status:remove’, source, ‘stress’, 1000000)” ve “TriggerServerEvent(“stress:remove”, 10000)” bunları denedim fakat bazen stress’i sıfırlıyor bazen sıfırlamıyor /heal yazdığımda stressi sıfırlasa da ilk girenlerde sorun çıkarıyor. Varmıdır bir çözümü?