Full View config.client.lua

Preview File Updated: v1.0.0 - 04.08.2023
function DrawText3D(x, y, z, text) -- This is the function used when using Config.Use3DText
SetTextScale(0.35, 0.35)
SetTextFont(4)
SetTextDropShadow()
SetTextProportional(1)
SetTextColour(255, 255, 255, 215)
SetTextEntry("STRING")
SetTextCentre(true)
AddTextComponentString(text)
SetDrawOrigin(x,y,z, 0)
DrawText(0.0, 0.0)
local factor = (string.len(text)) / 370
DrawRect(0.0, 0.0+0.0125, 0.017+ factor, 0.03, 0, 0, 0, 75)
ClearDrawOrigin()
end
local removeCondition = true
Citizen.CreateThread(function()
local waiting = 2000
while Config.StatisticsMenu["shooting"] do
Citizen.Wait(waiting)
local myPed = PlayerPedId()
waiting = 2000
local status, weapon = GetCurrentPedWeapon(myPed, true)
if status == 1 then
waiting = 10
if IsPedShooting(myPed) then
addSkill("shooting", type(Config.AddStatsValues['Shooting']) == "number" and Config.AddStatsValues['Shooting']/10.0 or math.random(Config.AddStatsValues['Shooting'][1], Config.AddStatsValues['Shooting'][2])/10.0)
Citizen.Wait(math.random(6500, 10000))
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(Config.RefreshTimeAddStats)
local myPed = PlayerPedId()
local myVehicle = GetVehiclePedIsUsing(myPed)
removeCondition = true
if IsPedRunning(myPed) then
addSkill("condition", type(Config.AddStatsValues['Running']) == "number" and Config.AddStatsValues['Running']/10.0 or math.random(Config.AddStatsValues['Running'][1], Config.AddStatsValues['Running'][2])/10.0)
removeCondition = false
elseif IsPedSwimmingUnderWater(myPed) then
addSkill("condition", type(Config.AddStatsValues['Swimming']) == "number" and Config.AddStatsValues['Swimming']/10.0 or math.random(Config.AddStatsValues['Swimming'][1], Config.AddStatsValues['Swimming'][2])/10.0)
removeCondition = false
elseif DoesEntityExist(myVehicle) then
local speed = GetEntitySpeed(myVehicle) * 3.6
if GetVehicleClass(myVehicle) == 13 and speed >= Config.AddStatsValues['Cycling'].minimumSpeed then
addSkill("condition", type(Config.AddStatsValues['Cycling'].value) == "number" and Config.AddStatsValues['Cycling'].value/10.0 or math.random(Config.AddStatsValues['Cycling'].value[1], Config.AddStatsValues['Cycling'].value[2])/10.0)
removeCondition = false
end
if speed >= Config.AddStatsValues['Driving'].minimumSpeed then
addSkill("driving", type(Config.AddStatsValues['Driving'].value) == "number" and Config.AddStatsValues['Driving'].value/10.0 or math.random(Config.AddStatsValues['Driving'].value[1], Config.AddStatsValues['Driving'].value[2])/10.0)
end
end
if myStatistics then
if myStatistics['strenght'] and Config.EnableStrenghtModifier then
if myStatistics['strenght'] >= 70.0 then
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 2.0)
elseif myStatistics['strenght'] >= 50.0 then
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.5)
elseif myStatistics['strenght'] >= 20.0 then
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.25)
else
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0)
end
end
if myStatistics['condition'] and Config.EnableRunSpeedModifier then
if myStatistics['condition'] >= 70.0 then
SetRunSprintMultiplierForPlayer(PlayerId(), 1.49)
elseif myStatistics['condition'] >= 50.0 then
SetRunSprintMultiplierForPlayer(PlayerId(), 1.35)
elseif myStatistics['condition'] >= 20.0 then
SetRunSprintMultiplierForPlayer(PlayerId(), 1.1)
else
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
end
end
end
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(Config.RefreshTimeRemoveStats)
if removeCondition then
removeSkill("condition", type(Config.RemoveStatsValues['RemoveCondition']) == "number" and Config.RemoveStatsValues['RemoveCondition']/10.0 or math.random(Config.RemoveStatsValues['RemoveCondition'][1], Config.RemoveStatsValues['RemoveCondition'][2])/10.0)
end
end
end)
Last modified 10d ago