-----------------------------------------------------------------------------------
------------------------------------------------------
-- VARIABLES
-----------------------------------------------------------------------------------
------------------------------------------------------
local playerReady = false
-----------------------------------------------------------------------------------
------------------------------------------------------
-- PLAYERREADY
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link]()
playerReady = true
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- THREADREADY
-----------------------------------------------------------------------------------
------------------------------------------------------
[Link](function()
NetworkSetFriendlyFireOption(true)
SetCanAttackFriendly(PlayerPedId(),true,true)
while true do
if playerReady then
local coords = GetEntityCoords(PlayerPedId())
vRPserver._updatePositions(coords.x,coords.y,coords.z)
end
[Link](10000)
end
end)
-----------------------------------------------------------------------------------
------------------------------------------------------
-- THREADREADY
-----------------------------------------------------------------------------------
------------------------------------------------------
[Link](function()
while true do
if playerReady then
vRPserver._updateHealth(GetEntityHealth(PlayerPedId()))
vRPserver._updateArmour(GetPedArmour(PlayerPedId()))
end
[Link](30000)
end
end)
-----------------------------------------------------------------------------------
------------------------------------------------------
-- GETHEALTH
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link]()
return GetEntityHealth(PlayerPedId())
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- SETHEALTH
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link](health)
SetEntityHealth(PlayerPedId(),parseInt(health))
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- UPDATEHEALTH
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link](number)
local ped = PlayerPedId()
local health = GetEntityHealth(ped)
if health > 101 then
SetEntityHealth(ped,parseInt(health+number))
end
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- DOWNHEALTH
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link](number)
local ped = PlayerPedId()
local health = GetEntityHealth(ped)
SetEntityHealth(ped,parseInt(health-number))
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- GETARMOUR
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link]()
return GetPedArmour(PlayerPedId())
end
-----------------------------------------------------------------------------------
------------------------------------------------------
-- SETARMOUR
-----------------------------------------------------------------------------------
------------------------------------------------------
function [Link](amount)
local ped = PlayerPedId()
local armour = GetPedArmour(ped)
SetPedArmour(ped,parseInt(armour+amount))
end
[Link](function()
while true do
[Link](1000)
if IsPlayerPlaying(PlayerId()) and playerReady then
vRPserver._updateWeapons([Link]())
end
end
end)