Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove Citizen. to bring format up-to-date #147

Merged
merged 4 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Citizen.CreateThread(function()
CreateThread(function()
-- ====================================================================
-- =--------------------- [GTA V: Single player] ---------------------=
-- ====================================================================
Expand Down
2 changes: 1 addition & 1 deletion dlc_afterhours/nightclubs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ AfterHoursNightclubs = {
if state then
RequestNamedPtfxAsset("scr_ba_club")
while not HasNamedPtfxAssetLoaded("scr_ba_club") do
Citizen.Wait(0)
Wait(0)
end

for key, emitter in pairs(AfterHoursNightclubs.Interior.DryIce.Emitters) do
Expand Down
16 changes: 8 additions & 8 deletions dlc_bikers/gang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ BikerGang = {
local IsTextureDictLoaded = LoadStreamedTextureDict(member.textureDict)

if not IsTextureDictLoaded then
Citizen.Trace("ERROR: BikerClubhouseDrawMembers - Textures dictionnary \"" .. tostring(member.textureDict) .. "\" cannot be loaded.")
print("ERROR: BikerClubhouseDrawMembers - Textures dictionnary \"" .. tostring(member.textureDict) .. "\" cannot be loaded.")
end
else
Citizen.Trace("ERROR: BikerClubhouseDrawMembers - PedHeadShot not ready.")
print("ERROR: BikerClubhouseDrawMembers - PedHeadShot not ready.")
end
end,
Clear = function(member)
Expand Down Expand Up @@ -347,7 +347,7 @@ BikerGang = {

Init = function()
if not DrawEmptyRect(BikerGang.Clubhouse.MissionsWall.target, BikerGang.Clubhouse.MissionsWall.prop) then
Citizen.Trace("ERROR: BikerGang.Clubhouse.MissionsWall.Init() - DrawEmptyRect - Timeout")
print("ERROR: BikerGang.Clubhouse.MissionsWall.Init() - DrawEmptyRect - Timeout")
end
end,
Enable = function(state)
Expand Down Expand Up @@ -433,7 +433,7 @@ BikerGang = {
}
}

Citizen.CreateThread(function()
CreateThread(function()
-- Removing the black texture
BikerGang.Clubhouse.Members.President.Init()
BikerGang.Clubhouse.Members.VicePresident.Init()
Expand Down Expand Up @@ -492,14 +492,14 @@ Citizen.CreateThread(function()
end
end

Citizen.Wait(0) -- We need to call all this every frame
Wait(0) -- We need to call all this every frame
else
-- Not in a clubhouse
Citizen.Wait(1000)
Wait(1000)
end
else
-- No load needed
Citizen.Wait(1000)
Wait(1000)
end
end
end)
Expand Down Expand Up @@ -549,7 +549,7 @@ function DrawEmblem(texturesDict, rotation)
local IsTextureDictLoaded = LoadStreamedTextureDict(texturesDict)

if not IsTextureDictLoaded then
Citizen.Trace("ERROR: DrawEmblem - Textures dictionnary cannot be loaded.")
print("ERROR: DrawEmblem - Textures dictionnary cannot be loaded.")
end

BikerGang.Clubhouse.Emblem.stage = 1
Expand Down
8 changes: 4 additions & 4 deletions dlc_doomsday/facility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ DoomsdayFacility = {

RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
Wait(0)
end

local privacyGlass = CreateObject(model, 367.99, 4827.745, -59.0, false, false, false)
Expand Down Expand Up @@ -211,7 +211,7 @@ DoomsdayFacility = {
if handle == 0 then
RequestModel(DoomsdayFacility.PrivacyGlass.controlModelHash)
while not HasModelLoaded(DoomsdayFacility.PrivacyGlass.controlModelHash) do
Citizen.Wait(0)
Wait(0)
end

local privacyGlass = CreateObjectNoOffset(DoomsdayFacility.PrivacyGlass.controlModelHash, DoomsdayFacility.PrivacyGlass.Bedroom.Control.position.x, DoomsdayFacility.PrivacyGlass.Bedroom.Control.position.y, DoomsdayFacility.PrivacyGlass.Bedroom.Control.position.z, false, false, false)
Expand Down Expand Up @@ -269,7 +269,7 @@ DoomsdayFacility = {
if entityToAttach ~= 0 then
RequestModel(glass.modelHash)
while not HasModelLoaded(glass.modelHash) do
Citizen.Wait(0)
Wait(0)
end

local privacyGlass = CreateObject(glass.modelHash, glass.entityPos.x, glass.entityPos.y, glass.entityPos.z, false, false, false)
Expand Down Expand Up @@ -301,7 +301,7 @@ DoomsdayFacility = {
if handle == 0 then
RequestModel(DoomsdayFacility.PrivacyGlass.controlModelHash)
while not HasModelLoaded(DoomsdayFacility.PrivacyGlass.controlModelHash) do
Citizen.Wait(0)
Wait(0)
end

local privacyGlass = CreateObjectNoOffset(DoomsdayFacility.PrivacyGlass.controlModelHash, DoomsdayFacility.PrivacyGlass.Lounge.Control.position.x, DoomsdayFacility.PrivacyGlass.Lounge.Control.position.y, DoomsdayFacility.PrivacyGlass.Lounge.Control.position.z, false, false, false)
Expand Down
10 changes: 4 additions & 6 deletions dlc_finance/office1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ FinanceOffice1 = {
elseif doorSide:lower() == "right" then
FinanceOffice1.Safe.isRightDoorOpen = true
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
Expand All @@ -126,8 +125,7 @@ FinanceOffice1 = {
elseif doorSide:lower() == "right" then
FinanceOffice1.Safe.isRightDoorOpen = false
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,

Expand All @@ -152,7 +150,7 @@ FinanceOffice1 = {
end

if doorHandle == 0 then
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end

Expand All @@ -165,7 +163,7 @@ FinanceOffice1 = {
local doorHandle = GetClosestObjectOfType(FinanceOffice1.Safe.Position.x, FinanceOffice1.Safe.Position.y, FinanceOffice1.Safe.Position.z, 5.0, doorHash, false, false, false)

while doorHandle == 0 do
Citizen.Wait(25)
Wait(25)

doorHandle = GetClosestObjectOfType(FinanceOffice1.Safe.Position.x, FinanceOffice1.Safe.Position.y, FinanceOffice1.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
Expand Down
10 changes: 4 additions & 6 deletions dlc_finance/office2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ FinanceOffice2 = {
elseif doorSide:lower() == "right" then
FinanceOffice2.Safe.isRightDoorOpen = true
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
Expand All @@ -126,8 +125,7 @@ FinanceOffice2 = {
elseif doorSide:lower() == "right" then
FinanceOffice2.Safe.isRightDoorOpen = false
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,

Expand All @@ -152,7 +150,7 @@ FinanceOffice2 = {
end

if doorHandle == 0 then
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end

Expand All @@ -165,7 +163,7 @@ FinanceOffice2 = {
local doorHandle = GetClosestObjectOfType(FinanceOffice2.Safe.Position.x, FinanceOffice2.Safe.Position.y, FinanceOffice2.Safe.Position.z, 5.0, doorHash, false, false, false)

while doorHandle == 0 do
Citizen.Wait(25)
Wait(25)

doorHandle = GetClosestObjectOfType(FinanceOffice2.Safe.Position.x, FinanceOffice2.Safe.Position.y, FinanceOffice2.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
Expand Down
10 changes: 4 additions & 6 deletions dlc_finance/office3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ FinanceOffice3 = {
elseif doorSide:lower() == "right" then
FinanceOffice3.Safe.isRightDoorOpen = true
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
Expand All @@ -126,8 +125,7 @@ FinanceOffice3 = {
elseif doorSide:lower() == "right" then
FinanceOffice3.Safe.isRightDoorOpen = false
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,

Expand All @@ -152,7 +150,7 @@ FinanceOffice3 = {
end

if doorHandle == 0 then
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end

Expand All @@ -165,7 +163,7 @@ FinanceOffice3 = {
local doorHandle = GetClosestObjectOfType(FinanceOffice3.Safe.Position.x, FinanceOffice3.Safe.Position.y, FinanceOffice3.Safe.Position.z, 5.0, doorHash, false, false, false)

while doorHandle == 0 do
Citizen.Wait(25)
Wait(25)

doorHandle = GetClosestObjectOfType(FinanceOffice3.Safe.Position.x, FinanceOffice3.Safe.Position.y, FinanceOffice3.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
Expand Down
10 changes: 4 additions & 6 deletions dlc_finance/office4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ FinanceOffice4 = {
elseif doorSide:lower() == "right" then
FinanceOffice4.Safe.isRightDoorOpen = true
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,
Close = function(doorSide)
Expand All @@ -126,8 +125,7 @@ FinanceOffice4 = {
elseif doorSide:lower() == "right" then
FinanceOffice4.Safe.isRightDoorOpen = false
else
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are:")
Citizen.Trace("left right")
print("[bob74_ipl] Warning: " .. doorSide .. " is not a correct value. Valid values are: left right")
end
end,

Expand All @@ -152,7 +150,7 @@ FinanceOffice4 = {
end

if doorHandle == 0 then
Citizen.Trace("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
print("[bob74_ipl] Warning: " .. doorSide .. " safe door handle is 0")
return
end

Expand All @@ -165,7 +163,7 @@ FinanceOffice4 = {
local doorHandle = GetClosestObjectOfType(FinanceOffice4.Safe.Position.x, FinanceOffice4.Safe.Position.y, FinanceOffice4.Safe.Position.z, 5.0, doorHash, false, false, false)

while doorHandle == 0 do
Citizen.Wait(25)
Wait(25)

doorHandle = GetClosestObjectOfType(FinanceOffice4.Safe.Position.x, FinanceOffice4.Safe.Position.y, FinanceOffice4.Safe.Position.z, 5.0, doorHash, false, false, false)
timeout = timeout - 1
Expand Down
10 changes: 5 additions & 5 deletions dlc_finance/organization.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ FinanceOrganization = {
}
}

Citizen.CreateThread(function()
CreateThread(function()
FinanceOrganization.Office.Init()

while true do
Expand All @@ -95,19 +95,19 @@ Citizen.CreateThread(function()

FinanceOrganization.Office.loaded = true

Citizen.Wait(0) -- We need to call all this every frame
Wait(0) -- We need to call all this every frame
else
Citizen.Wait(1000) -- We are not inside an office
Wait(1000) -- We are not inside an office
end
elseif FinanceOrganization.Office.loaded then
-- Loaded and need to unload
FinanceOrganization.Office.Clear()
FinanceOrganization.Office.loaded = false

Citizen.Wait(1000) -- We can wait longer when we don't need to display text
Wait(1000) -- We can wait longer when we don't need to display text
else
-- Not needed to load
Citizen.Wait(1000) -- We can wait longer when we don't need to display text
Wait(1000) -- We can wait longer when we don't need to display text
end
end
end)
Expand Down
2 changes: 1 addition & 1 deletion dlc_gunrunning/yacht.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ GunrunningYacht = {
if handle == 0 then
RequestModel(GunrunningYacht.Water.modelHash)
while not HasModelLoaded(GunrunningYacht.Water.modelHash) do
Citizen.Wait(0)
Wait(0)
end

local water = CreateObjectNoOffset(GunrunningYacht.Water.modelHash, -1369.0, 6736.0, 5.40, false, false, false)
Expand Down
2 changes: 1 addition & 1 deletion dlc_heists/yacht.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ HeistYacht = {
if handle == 0 then
RequestModel(HeistYacht.Water.modelHash)
while not HasModelLoaded(HeistYacht.Water.modelHash) do
Citizen.Wait(0)
Wait(0)
end

local water = CreateObjectNoOffset(HeistYacht.Water.modelHash, -2023.773, -1038.0, 5.40, false, false, false)
Expand Down
12 changes: 6 additions & 6 deletions lib/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function DrawEmptyRect(name, model)
local renderId = CreateNamedRenderTargetForModel(name, model)

while not IsNamedRendertargetRegistered(name) do
Citizen.Wait(step)
Wait(step)

currentTime = currentTime + step

Expand Down Expand Up @@ -197,7 +197,7 @@ function LoadStreamedTextureDict(texturesDict)

RequestStreamedTextureDict(texturesDict, false)
while not HasStreamedTextureDictLoaded(texturesDict) do
Citizen.Wait(step)
Wait(step)

currentTime = currentTime + step

Expand All @@ -216,7 +216,7 @@ function LoadScaleform(scaleform)
local handle = RequestScaleformMovie(scaleform)

while not HasScaleformMovieLoaded(handle) do
Citizen.Wait(step)
Wait(step)

currentTime = currentTime + step

Expand All @@ -235,7 +235,7 @@ function GetPedheadshot(ped)
local pedheadshot = RegisterPedheadshot(ped)

while not IsPedheadshotReady(pedheadshot) do
Citizen.Wait(step)
Wait(step)

currentTime = currentTime + step

Expand All @@ -257,10 +257,10 @@ function GetPedheadshotTexture(ped)
local IsTextureDictLoaded = LoadStreamedTextureDict(textureDict)

if not IsTextureDictLoaded then
Citizen.Trace("ERROR: GetPedheadshotTexture - Textures dictionnary \"" .. tostring(textureDict) .. "\" cannot be loaded.")
print("ERROR: GetPedheadshotTexture - Textures dictionnary \"" .. tostring(textureDict) .. "\" cannot be loaded.")
end
else
Citizen.Trace("ERROR: GetPedheadshotTexture - PedHeadShot not ready.")
print("ERROR: GetPedheadshotTexture - PedHeadShot not ready.")
end

return textureDict
Expand Down
4 changes: 2 additions & 2 deletions lib/observers/interiorIdObserver.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local _scanDelay = 500

Citizen.CreateThread(function()
CreateThread(function()
while true do
Global.currentInteriorId = GetInteriorFromEntity(PlayerPedId())

Expand Down Expand Up @@ -48,6 +48,6 @@ Citizen.CreateThread(function()
Global.Security.isInsideOffice4 = (Global.currentInteriorId == MpSecurityOffice4.InteriorId)
end

Citizen.Wait(_scanDelay)
Wait(_scanDelay)
end
end)
4 changes: 2 additions & 2 deletions lib/observers/officeSafeDoorHandler.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Delay between each attempt to open/close the doors corresponding to their state
local _scanDelay = 500

Citizen.CreateThread(function()
CreateThread(function()
while true do
local office = 0

Expand Down Expand Up @@ -42,6 +42,6 @@ Citizen.CreateThread(function()
end
end

Citizen.Wait(_scanDelay)
Wait(_scanDelay)
end
end)