Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Commit

Permalink
alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
ghermans committed Jan 11, 2019
1 parent af5b48e commit f8dc428
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 51 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.0-alpha2
* Added banner outside the nightclub.
* Added barrier outside the nightclub.
* Added static coordinates to spawn outside the club instead using safecoords.

## 1.0-alpha
* Added the nightclub blip.
* Added the nightclub interior.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We are planning to add more features soon.

## Installation
1. Download and extract the resource.
2. Copy the files to `resources/nightclubs`
3. Add `start nightclubs` to your server configuration file (**server.cfg**)
2. Copy the files to `resources/nightclubs`.
3. Add `start nightclubs` to your server configuration file (**server.cfg**).
4. start your server.

## Screenshot
Expand Down
102 changes: 60 additions & 42 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function PrepareClubInterior(interiorID)
for k,v in pairs(interiorsProps) do
if not IsInteriorPropEnabled(interiorID, v) then
EnableInteriorProp(interiorID, v)
Wait(20)
Wait(30)
end
end

Expand All @@ -53,26 +53,50 @@ function PrepareClubInterior(interiorID)
end

function TaskEnterNightClubGarage()
if not IsPedInAnyVehicle(playerPed, false) then
SetEntityCoords(playerPed, -1628.12, -2995.87, -78.1438-1.0)
else
SetPedCoordsKeepVehicle(playerPed, -1628.12, -2995.87, -78.1438-1.0)
end
Wait(100)
interiorID = GetInteriorAtCoordsWithType(-1604.664, -3012.583, -79.9999, "ba_dlc_int_01_ba")
if IsValidInterior(interiorID) then
LoadInterior(interiorID)
if IsInteriorReady(interiorID) then
PrepareClubInterior(interiorID)
if not DoesEntityExist(dj) then
dj = CreateDj(current_dj)
end

if not IsPedInAnyVehicle(playerPed, false) then
SetEntityCoords(playerPed, -1627.85, -3006.42, -78.7933-1.0)
else
SetPedCoordsKeepVehicle(playerPed, -1627.85, -3006.42, -78.7933-1.0)
end

if IsScreenFadedOut() then
DoScreenFadeIn(200)
Wait(250)
DisplayRadar(false)
SetGameplayCamRelativeHeading(12.1322)
SetGameplayCamRelativePitch(-3.2652, 1065353216)

StartAudioScene("DLC_Ba_NightClub_Scene")
PlaySoundFrontend(-1, "club_crowd_transition", "dlc_btl_club_open_transition_crowd_sounds", true)
end
end
DoScreenFadeIn(200)
end

Citizen.CreateThread(function()
DoScreenFadeIn(100)
RequestIpl("ba_case7_dixon")

for k,v in pairs(locations) do
local ix,iy,iz = table.unpack(v["markin"])
local blip = AddBlipForCoord(ix,iy,iz)

SetBlipSprite(blip, 614)
SetBlipNameFromTextFile(blip, "CLUB_QUICK_GPS")

if not IsIplActive(v["banner"]) then
RequestIpl(v["banner"])
end

if not IsIplActive(v["barrier"]) then
RequestIpl(v["barrier"])
end
end

while true do
Expand All @@ -85,41 +109,40 @@ Citizen.CreateThread(function()
local ix,iy,iz = table.unpack(v["markin"])
local gix, giy, giz = table.unpack(v["garage_in"])
local gox, goy, goz = table.unpack(v["garage_out"])
local ox, oy, oz = table.unpack(v["markout"])
local ox, oy, oz = table.unpack(v["markout"])

if GetDistanceBetweenCoords(coords, gix, giy, giz, true) < 50.5999 then
DrawMarker(1, gix, giy, giz-1.0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 238, 227, 79, 200, 0, 0, 2, 0, 0, 0, 0)
end

if GetDistanceBetweenCoords(coords, gox, goy, goz, true) < 2.0 then
if GetDistanceBetweenCoords(coords, gix, giy, giz, true) < 2.0 then
if not IsScreenFadingOut() then
DoScreenFadeOut(200)
end
TaskEnterNightClubGarage()
end

if GetDistanceBetweenCoords(coords, gox, goy, goz, true) < 3.0 then
if not IsScreenFadedOut() then
DoScreenFadeOut(200)
Wait(250)
CleanUpInterior(interiorID)

if success then
if k == k then
local fex, fey, fez = table.unpack(v["garage_exit"])
if not IsPedInAnyVehicle(playerPed, false) then
SetEntityCoords(playerPed, vec3.x, vec3.y, vec3.z-1.0)
SetEntityCoords(playerPed, fex, fey, fez-1.0)
else
SetPedCoordsKeepVehicle(playerPed, vec3.x, vec3.y, vec3.z-1.0)
SetPedCoordsKeepVehicle(playerPed, fex, fey, fez-1.0)
end

Wait(250)
DoScreenFadeIn(300)
DisplayRadar(true)
end
end
end


if GetDistanceBetweenCoords(coords, gix, giy, giz, true) < 2.0 then
local _, vector = GetNthClosestVehicleNode(coords.x, coords.y, coords.z, math.random(20, 180), 0, 0, 0)
success, vec3 = GetSafeCoordForPed(coords.x, coords.y, coords.z, false, 28)

if not IsScreenFadedOut() then
DoScreenFadeOut(200)
Wait(300)
TaskEnterNightClubGarage()
Wait(250)
DoScreenFadeIn(300)
end
end
end

if GetDistanceBetweenCoords(coords, ix, iy, iz, true) < 50.5999 then
DrawMarker(1, ix,iy,iz-1.0, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 238, 227, 79, 200, 0, 0, 2, 0, 0, 0, 0)
Expand All @@ -134,24 +157,19 @@ Citizen.CreateThread(function()
if not IsScreenFadedOut() then
DoScreenFadeOut(200)
Wait(250)
CleanUpInterior()
if success then
SetEntityCoords(playerPed, vec3.x, vec3.y, vec3.z-1.0)
CleanUpInterior(interiorID)
Wait(10)

if k == k then
local fex, fey, fez = table.unpack(v["exit"])
SetEntityCoords(playerPed, fex, fey, fez-1.0)
Wait(250)
DoScreenFadeIn(300)
end
end
end
end

if GetDistanceBetweenCoords(coords, ix, iy, iz, true) < 1.0 then
if not IsScreenFadedOut() then
local _, vector = GetNthClosestVehicleNode(coords.x, coords.y, coords.z, math.random(20, 180), 0, 0, 0)
success, vec3 = GetSafeCoordForPed(coords.x, coords.y, coords.z, false, 28)

DoScreenFadeOut(300)
Wait(350)
end

interiorID = GetInteriorAtCoordsWithType(-1604.664, -3012.583, -79.9999, "ba_dlc_int_01_ba")
if IsValidInterior(interiorID) then
LoadInterior(interiorID)
Expand All @@ -162,7 +180,7 @@ Citizen.CreateThread(function()
dj = CreateDj(current_dj)
end

SetEntityCoords(playerPed,-1591.4850, -3013.6070, -80.0060, 1, false, 0, 1)
SetEntityCoords(playerPed,-1591.4850, -3013.6070, -80.0060, 1, false, 0, 1)
SetEntityHeading(playerPed, 74.0804)

SetGameplayCamRelativeHeading(12.1322)
Expand Down
17 changes: 10 additions & 7 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ current_dj = "solomun"

-- Configure the coordinates for each nightclub
locations = {
["Elysian Island NightClub"] = {
["markin"] = {193.9785, -3167.5754, 5.79206},
["markout"] = {-1569.4477, -3017.4645, -74.40613},
["garage_in"] = {227.723, -3134.9400, 5.79027},
["garage_out"] = {-1642.03, -2989.63, -77.0078}
["Elysian Island"] = {
["markin"] = {193.9785, -3167.5754, 5.79206},
["markout"] = {-1569.4477, -3017.4645, -74.40613},
["garage_in"] = {227.723, -3134.9400, 5.79027},
["garage_out"] = {-1642.03, -2989.63, -77.0078},
["exit"] = {181.034, -3168.53, 5.60682},
["garage_exit"] = {209.345, -3120.75, 5.79027},
["banner"] = "ba_case7_" .. current_dj,
["barrier"] = "ba_barriers_case7",
}
}

Expand All @@ -17,7 +21,6 @@ interiorsProps = {
"Int01_ba_Style01",
"Int01_ba_Style02",
"Int01_ba_Style03",
"DJ_01_Lights_01",
"DJ_01_Lights_02",
"Int01_ba_style01_podium",
"Int01_ba_style02_podium",
Expand All @@ -33,4 +36,4 @@ interiorsProps = {
"Int01_ba_clubname_08",
"Int01_ba_dry_ice",
"Int01_ba_deliverytruck"
}
}

0 comments on commit f8dc428

Please sign in to comment.