This commit is contained in:
Jacob
2022-02-06 00:08:26 +00:00
51 changed files with 870 additions and 2 deletions
@@ -0,0 +1,4 @@
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
this_is_a_map 'yes'
data_file 'DLC_ITYP_REQUEST' 'stream/desert_bat_list.ytyp'
@@ -0,0 +1,38 @@
<html>
<head>
<!-- Need to include jQuery! -->
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.0/howler.js" type="text/javascript"></script>
<script>
var audioPlayer = null;
audioPlayer = new Howl({
src: ["./sounds.ogg"],
sprite: {
hit_1: [0, 291],
hit_2: [542, 865-542],
cue_hit: [1084, 1176-1084],
cushion_hit: [1306, 1354-1306],
pocket_1: [1480, 2262-1480],
pocket_2: [2396, 3094-2396]
}
});
function rand(sounds) {
return sounds[Math.floor(Math.random() * Math.floor(sounds.length))];
}
// Listen for NUI Messages.
window.addEventListener('message', function(event) {
// Check for playSound transaction
if (event.data.transactionType == "playSound") {
var id = audioPlayer.play(rand(event.data.sounds));
audioPlayer.pos(event.data.position.x, event.data.position.y, event.data.position.z, id);
audioPlayer.volume(event.data.volume, id);
} else if (event.data.transactionType == "setOrientation") {
Howler.orientation(event.data.fwd.x, event.data.fwd.y, event.data.fwd.z, event.data.up.x, event.data.up.y, event.data.up.z);
Howler.pos(event.data.coord.x, event.data.coord.y, event.data.coord.z)
}
});
</script>
</head>
</html>
Binary file not shown.
File diff suppressed because one or more lines are too long
+523
View File
@@ -0,0 +1,523 @@
WarMenu = { }
WarMenu.debug = false
local menus = { }
local keys = { up = 188, down = 187, left = 189, right = 190, select = 201, back = 202 }
local optionCount = 0
local currentKey = nil
local currentMenu = nil
local titleHeight = 0.11
local titleYOffset = 0.03
local titleScale = 1.0
local buttonHeight = 0.038
local buttonFont = 0
local buttonScale = 0.365
local buttonTextXOffset = 0.005
local buttonTextYOffset = 0.005
local function debugPrint(text)
if WarMenu.debug then
Citizen.Trace('[WarMenu] '..tostring(text))
end
end
local function setMenuProperty(id, property, value)
if id and menus[id] then
menus[id][property] = value
debugPrint(id..' menu property changed: { '..tostring(property)..', '..tostring(value)..' }')
end
end
local function isMenuVisible(id)
if id and menus[id] then
return menus[id].visible
else
return false
end
end
local function setMenuVisible(id, visible, holdCurrent)
if id and menus[id] then
setMenuProperty(id, 'visible', visible)
if not holdCurrent and menus[id] then
setMenuProperty(id, 'currentOption', 1)
end
if visible then
if id ~= currentMenu and isMenuVisible(currentMenu) then
setMenuVisible(currentMenu, false)
end
currentMenu = id
end
end
end
local function wDrawText(text, x, y, font, color, scale, center, shadow, alignRight)
SetTextColour(color.r, color.g, color.b, color.a)
SetTextFont(font)
SetTextScale(scale, scale)
if shadow then
SetTextDropShadow(2, 2, 0, 0, 0)
end
local menu = menus[currentMenu]
if menu then
if center then
SetTextCentre(center)
elseif alignRight then
SetTextWrap(menu.x, menu.x + menu.width - buttonTextXOffset)
SetTextRightJustify(true)
end
end
BeginTextCommandDisplayText("STRING")
AddTextComponentSubstringPlayerName(tostring(text))
EndTextCommandDisplayText(x, y)
end
local function wDrawRect(x, y, width, height, color)
DrawRect(x, y, width, height, color.r, color.g, color.b, color.a)
end
local function drawTitle()
local menu = menus[currentMenu]
if menu then
local x = menu.x + menu.width / 2
local y = menu.y + titleHeight / 2
if menu.titleBackgroundSprite then
DrawSprite(menu.titleBackgroundSprite.dict, menu.titleBackgroundSprite.name, x, y, menu.width, titleHeight, 0., 255, 255, 255, 255)
else
wDrawRect(x, y, menu.width, titleHeight, menu.titleBackgroundColor)
end
wDrawText(menu.title, x, y - titleHeight / 2 + titleYOffset, menu.titleFont, menu.titleColor, titleScale, true)
end
end
local function drawSubTitle()
local menu = menus[currentMenu]
if menu then
local x = menu.x + menu.width / 2
local y = menu.y + titleHeight + buttonHeight / 2
local subTitleColor = { r = menu.titleBackgroundColor.r, g = menu.titleBackgroundColor.g, b = menu.titleBackgroundColor.b, a = 255 }
wDrawRect(x, y, menu.width, buttonHeight, menu.subTitleBackgroundColor)
wDrawText(menu.subTitle, menu.x + buttonTextXOffset, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTitleColor, buttonScale, false)
if optionCount > menu.maxOptionCount then
wDrawText(tostring(menu.currentOption)..' / '..tostring(optionCount), menu.x + menu.width, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTitleColor, buttonScale, false, false, true)
end
end
end
local function drawButton(text, subText)
local menu = menus[currentMenu]
local x = menu.x + menu.width / 2
local multiplier = nil
if menu.currentOption <= menu.maxOptionCount and optionCount <= menu.maxOptionCount then
multiplier = optionCount
elseif optionCount > menu.currentOption - menu.maxOptionCount and optionCount <= menu.currentOption then
multiplier = optionCount - (menu.currentOption - menu.maxOptionCount)
end
if multiplier then
local y = menu.y + titleHeight + buttonHeight + (buttonHeight * multiplier) - buttonHeight / 2
local backgroundColor = nil
local textColor = nil
local subTextColor = nil
local shadow = false
if menu.currentOption == optionCount then
backgroundColor = menu.menuFocusBackgroundColor
textColor = menu.menuFocusTextColor
subTextColor = menu.menuFocusTextColor
else
backgroundColor = menu.menuBackgroundColor
textColor = menu.menuTextColor
subTextColor = menu.menuSubTextColor
shadow = true
end
wDrawRect(x, y, menu.width, buttonHeight, backgroundColor)
wDrawText(text, menu.x + buttonTextXOffset, y - (buttonHeight / 2) + buttonTextYOffset, buttonFont, textColor, buttonScale, false, shadow)
if subText then
wDrawText(subText, menu.x + buttonTextXOffset, y - buttonHeight / 2 + buttonTextYOffset, buttonFont, subTextColor, buttonScale, false, shadow, true)
end
end
end
function WarMenu.CreateMenu(id, title)
-- Default settings
menus[id] = { }
menus[id].title = title
menus[id].subTitle = 'INTERACTION MENU'
menus[id].visible = false
menus[id].previousMenu = nil
menus[id].aboutToBeClosed = false
menus[id].x = 0.0175
menus[id].y = 0.025
menus[id].width = 0.23
menus[id].currentOption = 1
menus[id].maxOptionCount = 10
menus[id].titleFont = 1
menus[id].titleColor = { r = 0, g = 0, b = 0, a = 255 }
menus[id].titleBackgroundColor = { r = 245, g = 127, b = 23, a = 255 }
menus[id].titleBackgroundSprite = nil
menus[id].menuTextColor = { r = 255, g = 255, b = 255, a = 255 }
menus[id].menuSubTextColor = { r = 189, g = 189, b = 189, a = 255 }
menus[id].menuFocusTextColor = { r = 0, g = 0, b = 0, a = 255 }
menus[id].menuFocusBackgroundColor = { r = 245, g = 245, b = 245, a = 255 }
menus[id].menuBackgroundColor = { r = 0, g = 0, b = 0, a = 160 }
menus[id].subTitleBackgroundColor = { r = menus[id].menuBackgroundColor.r, g = menus[id].menuBackgroundColor.g, b = menus[id].menuBackgroundColor.b, a = 255 }
menus[id].buttonPressedSound = { name = "SELECT", set = "HUD_FRONTEND_DEFAULT_SOUNDSET" } --https://pastebin.com/0neZdsZ5
debugPrint(tostring(id)..' menu created')
end
function WarMenu.CreateSubMenu(id, parent, subTitle)
if menus[parent] then
WarMenu.CreateMenu(id, menus[parent].title)
if subTitle then
setMenuProperty(id, 'subTitle', string.upper(subTitle))
else
setMenuProperty(id, 'subTitle', string.upper(menus[parent].subTitle))
end
setMenuProperty(id, 'previousMenu', parent)
setMenuProperty(id, 'x', menus[parent].x)
setMenuProperty(id, 'y', menus[parent].y)
setMenuProperty(id, 'maxOptionCount', menus[parent].maxOptionCount)
setMenuProperty(id, 'titleFont', menus[parent].titleFont)
setMenuProperty(id, 'titleColor', menus[parent].titleColor)
setMenuProperty(id, 'titleBackgroundColor', menus[parent].titleBackgroundColor)
setMenuProperty(id, 'titleBackgroundSprite', menus[parent].titleBackgroundSprite)
setMenuProperty(id, 'menuTextColor', menus[parent].menuTextColor)
setMenuProperty(id, 'menuSubTextColor', menus[parent].menuSubTextColor)
setMenuProperty(id, 'menuFocusTextColor', menus[parent].menuFocusTextColor)
setMenuProperty(id, 'menuFocusBackgroundColor', menus[parent].menuFocusBackgroundColor)
setMenuProperty(id, 'menuBackgroundColor', menus[parent].menuBackgroundColor)
setMenuProperty(id, 'subTitleBackgroundColor', menus[parent].subTitleBackgroundColor)
else
debugPrint('Failed to create '..tostring(id)..' submenu: '..tostring(parent)..' parent menu doesn\'t exist')
end
end
function WarMenu.CurrentMenu()
return currentMenu
end
function WarMenu.OpenMenu(id)
if id and menus[id] then
PlaySoundFrontend(-1, "SELECT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
setMenuVisible(id, true)
debugPrint(tostring(id)..' menu opened')
else
debugPrint('Failed to open '..tostring(id)..' menu: it doesn\'t exist')
end
end
function WarMenu.IsMenuOpened(id)
return isMenuVisible(id)
end
function WarMenu.IsAnyMenuOpened()
for id, _ in pairs(menus) do
if isMenuVisible(id) then return true end
end
return false
end
function WarMenu.IsMenuAboutToBeClosed()
local menu = menus[currentMenu]
if menu then
return menu.aboutToBeClosed
else
return false
end
end
function WarMenu.CloseMenu()
local menu = menus[currentMenu]
if menu then
if menu.aboutToBeClosed then
menu.aboutToBeClosed = false
setMenuVisible(currentMenu, false)
debugPrint(tostring(currentMenu)..' menu closed')
PlaySoundFrontend(-1, "QUIT", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
optionCount = 0
currentMenu = nil
currentKey = nil
else
menu.aboutToBeClosed = true
debugPrint(tostring(currentMenu)..' menu about to be closed')
end
end
end
function WarMenu.Button(text, subText)
local buttonText = text
if subText then
buttonText = '{ '..tostring(buttonText)..', '..tostring(subText)..' }'
end
local menu = menus[currentMenu]
if menu then
optionCount = optionCount + 1
local isCurrent = menu.currentOption == optionCount
drawButton(text, subText)
if isCurrent then
if currentKey == keys.select then
PlaySoundFrontend(-1, menu.buttonPressedSound.name, menu.buttonPressedSound.set, true)
debugPrint(buttonText..' button pressed')
return true
elseif currentKey == keys.left or currentKey == keys.right then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
end
end
return false
else
debugPrint('Failed to create '..buttonText..' button: '..tostring(currentMenu)..' menu doesn\'t exist')
return false
end
end
function WarMenu.MenuButton(text, id, subText)
if menus[id] then
if WarMenu.Button(text, subText) then
setMenuVisible(currentMenu, false)
setMenuVisible(id, true, true)
return true
end
else
debugPrint('Failed to create '..tostring(text)..' menu button: '..tostring(id)..' submenu doesn\'t exist')
end
return false
end
function WarMenu.CheckBox(text, checked, callback)
if WarMenu.Button(text, checked and 'On' or 'Off') then
checked = not checked
debugPrint(tostring(text)..' checkbox changed to '..tostring(checked))
if callback then callback(checked) end
return true
end
return false
end
function WarMenu.ComboBox(text, items, currentIndex, selectedIndex, callback)
local itemsCount = #items
local selectedItem = items[currentIndex]
local isCurrent = menus[currentMenu].currentOption == (optionCount + 1)
if itemsCount > 1 and isCurrent then
selectedItem = ''..tostring(selectedItem)..''
end
if WarMenu.Button(text, selectedItem) then
selectedIndex = currentIndex
callback(currentIndex, selectedIndex)
return true
elseif isCurrent then
if currentKey == keys.left then
if currentIndex > 1 then currentIndex = currentIndex - 1 else currentIndex = itemsCount end
elseif currentKey == keys.right then
if currentIndex < itemsCount then currentIndex = currentIndex + 1 else currentIndex = 1 end
end
else
currentIndex = selectedIndex
end
callback(currentIndex, selectedIndex)
return false
end
function WarMenu.Display()
if isMenuVisible(currentMenu) then
DisableControlAction(0, keys.left, true)
DisableControlAction(0, keys.up, true)
DisableControlAction(0, keys.down, true)
DisableControlAction(0, keys.right, true)
DisableControlAction(0, keys.back, true)
DisableControlAction(0, keys.select, true)
local menu = menus[currentMenu]
if menu.aboutToBeClosed then
WarMenu.CloseMenu()
else
ClearAllHelpMessages()
drawTitle()
drawSubTitle()
currentKey = nil
if IsDisabledControlJustReleased(0, keys.down) then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
if menu.currentOption < optionCount then
menu.currentOption = menu.currentOption + 1
else
menu.currentOption = 1
end
elseif IsDisabledControlJustReleased(0, keys.up) then
PlaySoundFrontend(-1, "NAV_UP_DOWN", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
if menu.currentOption > 1 then
menu.currentOption = menu.currentOption - 1
else
menu.currentOption = optionCount
end
elseif IsDisabledControlJustReleased(0, keys.left) then
currentKey = keys.left
elseif IsDisabledControlJustReleased(0, keys.right) then
currentKey = keys.right
elseif IsDisabledControlJustReleased(0, keys.select) then
currentKey = keys.select
elseif IsDisabledControlJustReleased(0, keys.back) then
if menus[menu.previousMenu] then
PlaySoundFrontend(-1, "BACK", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
setMenuVisible(menu.previousMenu, true)
else
WarMenu.CloseMenu()
end
end
optionCount = 0
end
end
end
function WarMenu.CurrentOption()
if currentMenu and optionCount ~= 0 and menus[currentMenu] then
return menus[currentMenu].currentOption
end
return nil
end
function WarMenu.SetMenuWidth(id, width)
setMenuProperty(id, 'width', width)
end
function WarMenu.SetMenuX(id, x)
setMenuProperty(id, 'x', x)
end
function WarMenu.SetMenuY(id, y)
setMenuProperty(id, 'y', y)
end
function WarMenu.SetMenuMaxOptionCountOnScreen(id, count)
setMenuProperty(id, 'maxOptionCount', count)
end
function WarMenu.SetTitle(id, title)
setMenuProperty(id, 'title', title)
end
function WarMenu.SetTitleColor(id, r, g, b, a)
setMenuProperty(id, 'titleColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].titleColor.a })
end
function WarMenu.SetTitleBackgroundColor(id, r, g, b, a)
setMenuProperty(id, 'titleBackgroundColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].titleBackgroundColor.a })
end
function WarMenu.SetTitleBackgroundSprite(id, textureDict, textureName)
RequestStreamedTextureDict(textureDict)
setMenuProperty(id, 'titleBackgroundSprite', { dict = textureDict, name = textureName })
end
function WarMenu.SetSubTitle(id, text)
setMenuProperty(id, 'subTitle', string.upper(text))
end
function WarMenu.SetMenuBackgroundColor(id, r, g, b, a)
setMenuProperty(id, 'menuBackgroundColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuBackgroundColor.a })
end
function WarMenu.SetMenuTextColor(id, r, g, b, a)
setMenuProperty(id, 'menuTextColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuTextColor.a })
end
function WarMenu.SetMenuSubTextColor(id, r, g, b, a)
setMenuProperty(id, 'menuSubTextColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuSubTextColor.a })
end
function WarMenu.SetMenuFocusColor(id, r, g, b, a)
setMenuProperty(id, 'menuFocusColor', { ['r'] = r, ['g'] = g, ['b'] = b, ['a'] = a or menus[id].menuFocusColor.a })
end
function WarMenu.SetMenuButtonPressedSound(id, name, set)
setMenuProperty(id, 'buttonPressedSound', { ['name'] = name, ['set'] = set })
end
+136
View File
@@ -0,0 +1,136 @@
Config = {
License = 'tumadreesputa', -- Insert your rcore license
NotificationDistance = 10.0,
PropsToRemove = {
vector3(1992.803, 3047.312, 46.22865),
},
--[[
-- To use custom notifications, implement client event handler, example:
AddEventHandler('rcore_pool:notification', function(serverId, message)
print(serverId, message)
end)
]]
CustomNotifications = false,
--[[
-- To use custom menu, implement following client handlers
AddEventHandler('rcore_pool:openMenu', function()
-- open menu with your system
end)
AddEventHandler('rcore_pool:closeMenu', function()
-- close menu, player has walked far from table
end)
-- After selecting game type, trigger one of the following setupTable events
TriggerEvent('rcore_pool:setupTable', 'BALL_SETUP_8_BALL')
TriggerEvent('rcore_pool:setupTable', 'BALL_SETUP_STRAIGHT_POOL')
]]
CustomMenu = false,
--[[
When you want your players to pay to play pool, set this to true
AND implement the following server handler in your framework of choice.
The handler MUST deduct money from the player and then CALL the callback
if the payment is successful, or inform the player of payment failure.
This script itself DOES NOT implement ESX/vRP logic, you have to do that yourself.
AddEventHandler('rcore_pool:payForPool', function(playerServerId, cb)
print("This should be replaced by deducting money from " .. playerServerId)
cb() -- successfuly set balls on table
end)
]]
PayForSettingBalls = false,
BallSetupCost = nil, -- for example: "$1" or "$200" - any text
--[[
You can integrate pool cue into your system with
SERVERSIDE HANDLERS
- rcore_pool:onReturnCue - called when player takes cue
- rcore_pool:onTakeCue - called when player returns cue
CLIENTSIDE EVENTS
- rcore_pool:takeCue - forces player to take cue in hand
- rcore_pool:removeCue - removes cue from player's hand
This prevents players from taking cue from cue rack if `false`
]]
AllowTakePoolCueFromStand = true,
--[[
This option is for servers whose anticheats prevents
this script from setting players invisible.
When player's ped is blocking camera when aiming,
set this to true
]]
DoNotRotateAroundTableWhenAiming = false,
MenuColor = {245, 127, 23},
Keys = {
BACK = {code = 200, label = 'INPUT_FRONTEND_PAUSE_ALTERNATE'},
ENTER = {code = 38, label = 'INPUT_PICKUP'},
SETUP_MODIFIER = {code = 21, label = 'INPUT_SPRINT'},
CUE_HIT = {code = 179, label = 'INPUT_CELLPHONE_EXTRA_OPTION'},
CUE_LEFT = {code = 174, label = 'INPUT_CELLPHONE_LEFT'},
CUE_RIGHT = {code = 175, label = 'INPUT_CELLPHONE_RIGHT'},
AIM_SLOWER = {code = 21, label = 'INPUT_SPRINT'},
BALL_IN_HAND = {code = 29, label = 'INPUT_SPECIAL_ABILITY_SECONDARY'},
BALL_IN_HAND_LEFT = {code = 174, label = 'INPUT_CELLPHONE_LEFT'},
BALL_IN_HAND_RIGHT = {code = 175, label = 'INPUT_CELLPHONE_RIGHT'},
BALL_IN_HAND_UP = {code = 172, label = 'INPUT_CELLPHONE_UP'},
BALL_IN_HAND_DOWN = {code = 173, label = 'INPUT_CELLPHONE_DOWN'},
},
Text = {
BACK = "Volver",
HIT = "Golpear",
BALL_IN_HAND = "Ball-in-Hand",
BALL_IN_HAND_BACK = "Volver",
AIM_LEFT = "Apuntar a la izq",
AIM_RIGHT = "Apuntar a la der",
AIM_SLOWER = "Apuntar lentamente",
POOL = 'Billar',
POOL_GAME = 'Partida del billar',
POOL_SUBMENU = 'Configuración',
TYPE_8_BALL = '8-ball',
TYPE_STRAIGHT = 'Straight pool',
HINT_SETUP = 'Colocar mesa',
HINT_TAKE_CUE = 'Coger palo',
HINT_RETURN_CUE = 'Dejar palo',
HINT_HINT_TAKE_CUE = 'Para jugar debes coger un palo',
HINT_PLAY = 'Jugar',
BALL_IN_HAND_LEFT = 'Izquierda',
BALL_IN_HAND_RIGHT = 'Derecha',
BALL_IN_HAND_UP = 'Arriba',
BALL_IN_HAND_DOWN = 'Abajo',
BALL_POCKETED = '%s ha sido metida',
BALL_IN_HAND_NOTIFY = 'El jugador tiene la bola blanca en la mano',
BALL_LABELS = {
[-1] = 'Blanca',
[1] = '~y~Lisa 1~s~',
[2] = '~b~Lisa 2~s~',
[3] = '~r~Lisa 3~s~',
[4] = '~p~Lisa 4~s~',
[5] = '~o~Lisa 5~s~',
[6] = '~g~Lisa 6~s~',
[7] = '~r~Lisa 7~s~',
[8] = 'Negra Lisa 8',
[9] = '~y~Rayada 9~s~',
[10] = '~b~Rayada 10~s~',
[11] = '~r~Rayada 11~s~',
[12] = '~p~Rayada 12~s~',
[13] = '~o~Rayada 13~s~',
[14] = '~g~Rayada 14~s~',
[15] = '~r~Rayada 15~s~',
}
},
}
+26
View File
@@ -0,0 +1,26 @@
fx_version 'bodacious'
game 'gta5'
description 'TEB tennis'
version '1.2.0'
client_scripts {
'config.lua',
'client/warmenu.lua',
'client/run.lua',
}
server_scripts {
'server/crack.lua',
'config.lua',
'server/code.lua',
'server/run.lua',
}
ui_page('client/html/sound.html')
files {
'client/html/sound.html',
'client/html/*.ogg',
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -159,6 +159,7 @@ start Laptop-UI
start carsounds
start carsounds4
start EasyDrift
start rcore_pool
#[-----Discord Perms-----]
start discord_perms
@@ -188,7 +189,6 @@ start Katana
#[-----Map Add-On-----]
start ad2
start SandyShores-Hospital
start SandyShores-PD
start Flywheels
start casinointerior
start Hill-Mansion
@@ -280,7 +280,7 @@ start oficina_shell_col
start nve_iced_alamo
start ballasint
start vagosint
start patoche_billiard
#[-----Mt. Zonah Hospital-----]
start urgence_floor
start room_floor